Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: edk2: Bump to 202308 #139

Closed

Conversation

mihalicyn
Copy link
Member

@mihalicyn mihalicyn commented Sep 1, 2023

Fixes canonical/lxd#12166

Not ready yet as I need to solve a build issue:

2023-09-01 14:28:49.855 :: 2023-09-01 12:28:46.988 :: ###
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:46.988 :: Generating DXEFV FV
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.970 :: ########### ['GenFv', '-a', '/root/parts/edk2/build/Build/OvmfX64/RELEASE_GCC5/FV/Ffs/FVMAIN_COMPACT.inf', '-o', '/root/parts/edk2/build/Build/OvmfX64/RELEASE_GCC5/FV/FVMAIN_COMPACT.Fv', '-i', '/root/parts/edk2/build/Build/OvmfX64/RELEASE_GCC5/FV/FVMAIN_COMPACT.inf']
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.970 :: Return Value = 2
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.970 :: GenFv: ERROR 3000: Invalid
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.970 ::   the required fv image size 0x1b9180 exceeds the set fv image size 0x1ac000
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.970 ::
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.971 ::
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.971 ::
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.971 ::
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.971 :: build.py...
2023-09-01 14:28:49.855 :: 2023-09-01 12:28:48.971 ::  : error 7000: Failed to generate FV

Fixes canonical/lxd#12166

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
@mihalicyn
Copy link
Member Author

mihalicyn commented Sep 1, 2023

Most likely size of the firmware increased after tianocore/edk2@ff3382a
Will need to experiment with this thing more.

0x1ac000 is a standard FV block size for 2MiB firmware:
https://github.com/tianocore/edk2/blob/beafabdae49c873adecdb7511dbebe9d4ff5c8f0/OvmfPkg/Include/Fdf/OvmfPkgDefines.fdf.inc#L48

We fail on 2MiB firmware which does not include CSM blob.

This allows to build 2MiB image:

       build_edk2 \
         "${CRAFT_PART_INSTALL}/share/qemu/OVMF_CODE.2MB.fd" \
         "${CRAFT_PART_INSTALL}/share/qemu/OVMF_VARS.2MB.fd" \
-        -DFD_SIZE_2MB
+        -DFD_SIZE_2MB \
+        -DNETWORK_ISCSI_ENABLE=FALSE \
+        -DBUILD_SHELL=FALSE
       ln -s OVMF_CODE.2MB.fd ${CRAFT_PART_INSTALL}/share/qemu/OVMF_CODE.fd
       ln -s OVMF_VARS.2MB.fd ${CRAFT_PART_INSTALL}/share/qemu/OVMF_VARS.fd

I don't think that we need to build iSCSI support in UEFI firmware (we don't use iSCSI as far as I understand).
But I'm not sure about UEFI Shell. Nobody uses it in 99% cases, but...

As an alternative we can build 4MB blob from the new version of edk2, and 2MB from the old one.

@simondeziel
Copy link
Member

simondeziel commented Sep 2, 2023

IIRC the UEFI shell was sometimes mentioned in forum posts for debugging issues with booting Windows from an ISO.

As for the iSCSI support, it sounds reasonable to drop and I'd vote to drop it from all build variants, not just the 2MiB one.

@tomponline
Copy link
Member

Yeah let's drop iscsi from all variants

@tomponline
Copy link
Member

Any other features we can drop?

@simondeziel
Copy link
Member

We might be able to reclaim some space by disabling TPM1 support (-DTPM1_ENABLE=FALSE) but I'm not sure if (existing) LXD VMs would be affected.

@tomponline
Copy link
Member

tomponline commented Sep 4, 2023

Whilst replying to

https://discourse.ubuntu.com/t/lxd-vm-agent-fails-to-come-online-with-lxd-5-15-and-large-vm-resource-requirements/37963/12

I noticed that we had some TPM disable flags in the past on edk2 as well:

dadf771

@mihalicyn
Copy link
Member Author

I noticed that we had some TPM disable flags in the past on edk2 as well:

yes, at the same time, both TPM_ENABLE and TPM_CONFIG_ENABLE are not existing in the edk2 code-base anymore.
tianocore/edk2@4de8d61

As far as I can see TPM1_ENABLE is TRUE by default.

@tomponline
Copy link
Member

@mihalicyn will you be able to pick this back up after we remove the CSM support as per canonical/lxd#12730

@mihalicyn mihalicyn closed this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants