Skip to content

Commit 7ba6547

Browse files
committed
grub-efi: add support for build without shim
In `meta-signing-key/classes/user-key-store.bbclass` file, there is already an implementation of sb_sign() function with support for both scerarions: - bootloader is verified by shim_cert.crt - shim is not used, and DB.crt is used to verify bootloader directly but when building with MOK_SB ?= "0", grub is being build as `grub(ia32/x64).efi` and with shim_lock support enabled. Disabling shim_lock for running secure boot without shim fixes the issue: error: ../../grub-core/kern/efi/sb.c:180:shim_lock protocol not found. during boot. Disabling renaming of grub efi into `grubx64.efi` leaves it, as it is in EFI_BOOT_IMAGE variable, set in `yocto/openembedded-core/meta/conf/image-uefi.conf`, as this will be our first efi boot file. Signed-off-by: Piotr Łobacz <[email protected]>
1 parent dca45d8 commit 7ba6547

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ GRUB_SECURE_BUILDIN:append:class-target = " \
4848
${GRUB_SELOADER_MODULES} \
4949
${GRUB_TPM_MODULES} \
5050
--sbat ${WORKDIR}/sbat.csv \
51-
${@'--disable-shim-lock' if d.getVar('UEFI_SELOADER') == '1' else ''} \
51+
${@'--disable-shim-lock' if d.getVar('UEFI_SELOADER') == '1' or d.getVar('MOK_SB') != "1" else ''} \
5252
"
5353

5454
# Set a default root specifier.
5555
inherit user-key-store
5656

5757
python __anonymous () {
58-
if d.getVar('UEFI_SB') != "1":
58+
if d.getVar('UEFI_SB') != "1" or d.getVar('MOK_SB') != "1":
5959
return
6060

6161
# Override the default filename if efi-secure-boot enabled.

0 commit comments

Comments
 (0)