From: Michael Prokop Date: Wed, 22 Feb 2023 14:02:28 +0000 (+0100) Subject: Increase EFI image size when using Secure Boot on amd64 X-Git-Tag: v0.43.2~1^2 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=842c047189a7b6b6c5bb9f152624b90ad2e3a2f9 Increase EFI image size when using Secure Boot on amd64 Now as of git commit 721a473 the disk usage of the Secure Boot files increased and 4MB are no longer enough. We don't support Secure Boot for i386, so when either building for i386 or amd64 without Secure Boot then keep the default 4MB size. But if Secure Boot is not disabled and when not building for i386 (:= amd64) then increase EFI size to 8MB. Thanks: János Pásztor for bugreport and initial patch --- diff --git a/grml-live b/grml-live index 6002d8c..6710037 100755 --- a/grml-live +++ b/grml-live @@ -915,6 +915,14 @@ grub_setup() { BOOTX32="/boot/bootia32.efi" EFI_IMG="/boot/efi.img" + local efi_size + if [[ "${SECURE_BOOT:-}" == "disable" ]] || [[ "${ARCH:-}" == "i386" ]] ; then + efi_size='4M' + else + # e.g. templates/EFI/debian for Secure Boot has >4MB and needs more space + efi_size='8M' + fi + if [[ "$ARCH" == "amd64" ]] ; then # important: this depends on execution of ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/45-grub-images if ! [ -r "${CHROOT_OUTPUT}/${BOOTX64}" ] ; then @@ -925,7 +933,7 @@ grub_setup() { bailout 50 fi - dd if=/dev/zero of="${CHROOT_OUTPUT}/${EFI_IMG}" bs=4M count=1 2>/dev/null || bailout 50 + dd if=/dev/zero of="${CHROOT_OUTPUT}/${EFI_IMG}" bs="${efi_size}" count=1 2>/dev/null || bailout 50 mkfs.vfat -n GRML "${CHROOT_OUTPUT}/${EFI_IMG}" >/dev/null || bailout 51 mmd -i "${CHROOT_OUTPUT}/${EFI_IMG}" ::EFI || bailout 52 mmd -i "${CHROOT_OUTPUT}/${EFI_IMG}" ::EFI/BOOT || bailout 52 @@ -1004,7 +1012,7 @@ grub_setup() { bailout 50 fi - dd if=/dev/zero of="${CHROOT_OUTPUT}/${EFI_IMG}" bs=4M count=1 2>/dev/null || bailout 50 + dd if=/dev/zero of="${CHROOT_OUTPUT}/${EFI_IMG}" bs="${efi_size}" count=1 2>/dev/null || bailout 50 mkfs.vfat -n GRML "${CHROOT_OUTPUT}/${EFI_IMG}" >/dev/null || bailout 51 mmd -i "${CHROOT_OUTPUT}/${EFI_IMG}" ::EFI || bailout 52 mmd -i "${CHROOT_OUTPUT}/${EFI_IMG}" ::EFI/BOOT || bailout 52