non-free firmware detection: in chroot, not on host

Follow-up for 18ad612b72.
The availability of 'firmware-linux' must be checked inside the chroot
instead of on the host.
This fixes building Bullseye without 'non-free' available (as discovered
by autopkgtest)
This commit is contained in:
Roland Clobus 2023-06-21 09:04:08 +02:00
parent dd916ac5be
commit ba34bfbfd0
No known key found for this signature in database
GPG Key ID: 62C57C6AA61495BD
2 changed files with 20 additions and 4 deletions

View File

@ -54,9 +54,17 @@ Check_package host /usr/bin/wget wget
FIRMWARE_PACKAGES=""
# Manually add firmware-linux meta package if available
if [ $(apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ]
if [ "${LB_BUILD_WITH_CHROOT}" = "true" ]
then
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
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
fi
Firmware_List_From_Contents "${LB_PARENT_MIRROR_CHROOT}" "${LB_PARENT_DISTRIBUTION_CHROOT}" "${LB_PARENT_ARCHIVE_AREAS}"

View File

@ -402,9 +402,17 @@ then
FIRMWARE_PACKAGES=""
# Manually add firmware-linux meta package if available
if [ $(apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ]
if [ "${LB_BUILD_WITH_CHROOT}" = "true" ]
then
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
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
fi
Firmware_List_From_Contents "${LB_PARENT_MIRROR_CHROOT}" "${LB_PARENT_DISTRIBUTION_CHROOT}" "${LB_PARENT_ARCHIVE_AREAS}"