diff --git a/functions/packages.sh b/functions/packages.sh index 9e25df5f3..2481edc25 100755 --- a/functions/packages.sh +++ b/functions/packages.sh @@ -145,3 +145,28 @@ Check_installed () fi } +# $1 = Packagename +# Echoes: +# 1 if the package is available +# 0 otherwise +Check_package_available () +{ + local _PACKAGE="${1}" + + if [ "${LB_BUILD_WITH_CHROOT}" = "true" ] + then + if [ $(Chroot chroot apt-cache show "^${_PACKAGE}$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ] + then + echo 1 + return + fi + else + if [ $(apt-cache show "^${_PACKAGE}$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ] + then + echo 1 + return + fi + fi + echo 0 +} + diff --git a/scripts/build/chroot_firmware b/scripts/build/chroot_firmware index 4d8613fdf..d198ba267 100755 --- a/scripts/build/chroot_firmware +++ b/scripts/build/chroot_firmware @@ -54,17 +54,9 @@ Check_package host /usr/bin/wget wget FIRMWARE_PACKAGES="" # Manually add firmware-linux meta package if available -if [ "${LB_BUILD_WITH_CHROOT}" = "true" ] +if [ $(Check_package_available "firmware-linux") -eq 1 ] then - if [ $(Chroot chroot apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ] - then - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" - fi -else - if [ $(apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ] - then - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" - fi + FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" fi Firmware_List_From_Contents "${LB_PARENT_MIRROR_CHROOT}" "${LB_PARENT_DISTRIBUTION_CHROOT}" "${LB_PARENT_ARCHIVE_AREAS}" diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index 5045741d5..22ea61e6b 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -380,7 +380,26 @@ then case "${LB_ARCHITECTURE}" in amd64) - DI_REQ_PACKAGES="grub-pc grub-common libefiboot1 libefiboot1t64 libefivar1 libefivar1t64 libfuse2 libfuse2t64 libfuse3-3" # BIOS + DI_REQ_PACKAGES="grub-pc grub-common libfuse3-3" # BIOS + # Starting in trixie, the t64-packages have a 64-bit timestamp + if [ $(Check_package_available "libefiboot1t64") -eq 1 ] + then + DI_REQ_PACKAGES="${DI_REQ_PACKAGES} libefiboot1t64" + else + DI_REQ_PACKAGES="${DI_REQ_PACKAGES} libefiboot1" + fi + if [ $(Check_package_available "libefivar1t64") -eq 1 ] + then + DI_REQ_PACKAGES="${DI_REQ_PACKAGES} libefivar1t64" + else + DI_REQ_PACKAGES="${DI_REQ_PACKAGES} libefivar1" + fi + if [ $(Check_package_available "libfuse2t64") -eq 1 ] + then + DI_REQ_PACKAGES="${DI_REQ_PACKAGES} libfuse2t64" + else + DI_REQ_PACKAGES="${DI_REQ_PACKAGES} libfuse2" + fi DI_REQ_PACKAGES="${DI_REQ_PACKAGES} grub-efi-amd64 efibootmgr grub-efi-amd64-signed shim-signed" # UEFI (required for d-i, includes suggested packages) DI_REQ_PACKAGES="${DI_REQ_PACKAGES} efibootmgr grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common mokutil shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned cryptsetup cryptsetup-initramfs keyutils" # UEFI (required by Calamares) DI_PACKAGES="linux-image-amd64" @@ -417,17 +436,9 @@ then FIRMWARE_PACKAGES="" # Manually add firmware-linux meta package if available - if [ "${LB_BUILD_WITH_CHROOT}" = "true" ] + if [ $(Check_package_available "firmware-linux") -eq 1 ] then - if [ $(Chroot chroot apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ] - then - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" - fi - else - if [ $(apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ] - then - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" - fi + FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" fi Firmware_List_From_Contents "${LB_PARENT_MIRROR_CHROOT}" "${LB_PARENT_DISTRIBUTION_CHROOT}" "${LB_PARENT_ARCHIVE_AREAS}"