Tom is absolutely right in that we depend on UEFI Shell thing to enroll Secure boot keys and generate NVRAM:
# 4MB variant
./edk2-vars-generator -f "${FIRMWARE}" \
-e ../../edk2/build/Build/*/*/*/EnrollDefaultKeys.efi \
-s ../../edk2/build/Build/*/*/*/Shell.efi \
-c "${CRAFT_STAGE}/share/qemu/OVMF_CODE.4MB.fd" \
-V "${CRAFT_STAGE}/share/qemu/OVMF_VARS.4MB.fd" \
-C "$(cat ubuntu-sb.crt)" \
-o "${CRAFT_PART_INSTALL}/share/qemu/OVMF_VARS.4MB.ms.fd"
So, we can't just disable it. Before that we need to learn how to generate NVRAM and enroll Secure Boot keys without it.
Theoretically, we can build a firmware with shell at first step, then generate NVRAM, then build firmware without shell but take NVRAM from the previous step. NVRAM format is compatible between different builds of UEFI if they have the same FD_SIZE.
Tom is absolutely right in that we depend on UEFI Shell thing to enroll Secure boot keys and generate NVRAM: /edk2-vars- generator -f "${FIRMWARE}" \ build/Build/ */*/*/EnrollDef aultKeys. efi \ build/Build/ */*/*/Shell. efi \ STAGE}/ share/qemu/ OVMF_CODE. 4MB.fd" \ STAGE}/ share/qemu/ OVMF_VARS. 4MB.fd" \ PART_INSTALL} /share/ qemu/OVMF_ VARS.4MB. ms.fd"
# 4MB variant
.
-e ../../edk2/
-s ../../edk2/
-c "${CRAFT_
-V "${CRAFT_
-C "$(cat ubuntu-sb.crt)" \
-o "${CRAFT_
Source: https:/ /github. com/canonical/ lxd-pkg- snap/blob/ 208ea1256a64c3f 7116c5f8e5e279b d0238705d2/ snapcraft. yaml#L962
So, we can't just disable it. Before that we need to learn how to generate NVRAM and enroll Secure Boot keys without it.
Theoretically, we can build a firmware with shell at first step, then generate NVRAM, then build firmware without shell but take NVRAM from the previous step. NVRAM format is compatible between different builds of UEFI if they have the same FD_SIZE.