[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1088650: Bookworm arm64 builds are broken with `--debian-installer live`



Package: live-build
Version: 1:20240810
Severity: normal
Tags: upstream, patch
X-Debbugs-Cc: adrelanos@kicksecure.com, arraybolt3@gmail.com

(Note, I'm using a version of live-build installed with `sudo make
install` that is currently six commits behind git master, however I've
checked the code and this bug should still exist in git master.)

Apparently the grub-efi-ARCH-unsigned packages did not exist in
Bookworm, and only exist in Trixie and later. live-build's
`installer_debian-installer` step seems to be aware of this fact for
amd64 builds and uses an if/then to check if grub-efi-amd64-unsigned is
available before adding it to DI_REQ_PACKAGES. For arm64 builds
however, grub-efi-arm64-unsigned is unconditionally added to
DI_REQ_PACKAGES. As a result, if you attempt to build an arm64 Bookworm
image with debian-installer enabled, the build crashes with `E: Unable
to locate package grub-efi-arm64-unsigned`.

To reproduce the issue on an amd64 machine (since I'm cross-building):

* mkdir lb-test
* cd lb-test
* lb config \
  --architecture arm64 \
  --bootstrap-qemu-arch arm64 \
  --bootstrap-qemu-static /usr/bin/qemu-aarch64-static \
  --debian-installer live
* sudo lb build

The build will die on the debian-installer step with the aforementioned
error.

I have not yet tested the following patch, but I think this will fix
the problem:

diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer
index 6e47246d1..f11b8aa76 100755
--- a/scripts/build/installer_debian-installer
+++ b/scripts/build/installer_debian-installer
@@ -429,7 +429,12 @@ then
 
 		arm64)
 			DI_REQ_PACKAGES="grub-efi-arm64 efibootmgr grub-efi-arm64-signed shim-signed" # UEFI (required for d-i, includes suggested packages)
-			DI_REQ_PACKAGES="${DI_REQ_PACKAGES} grub-efi grub-efi-arm64-bin grub2-common mokutil shim-helpers-arm64-signed shim-signed-common shim-unsigned grub-efi-arm64-unsigned" # UEFI (required by Calamares)
+			DI_REQ_PACKAGES="${DI_REQ_PACKAGES} grub-efi grub-efi-arm64-bin grub2-common mokutil shim-helpers-arm64-signed shim-signed-common shim-unsigned" # UEFI (required by Calamares)
+			# grub-efi-arm64-unsigned was introduced in trixie
+			if [ $(Check_package_available "grub-efi-arm64-unsigned") -eq 1 ]
+			then
+				DI_REQ_PACKAGES="${DI_REQ_PACKAGES} grub-efi-arm64-unsigned"
+			fi
 			DI_PACKAGES="linux-image-arm64"
 			;;
 

-- System Information:
Debian Release: 12.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500,
'stable'), (100, 'bookworm-fasttrack') Architecture: amd64 (x86_64)

Attachment: pgpBV2MtBDa5B.pgp
Description: OpenPGP digital signature


Reply to: