Add support for non-free-firmware

This commit is contained in:
Roland Clobus 2023-03-12 00:16:04 +01:00
parent efa9ed8b59
commit 50c7e1a8b7
No known key found for this signature in database
GPG Key ID: 62C57C6AA61495BD
3 changed files with 28 additions and 6 deletions

View File

@ -53,8 +53,11 @@ Check_package host /usr/bin/wget wget
FIRMWARE_PACKAGES=""
# Manually add firmware-linux/non-free meta package
if [ "${LB_DERIVATIVE}" = "false" ] && In_list "non-free" ${LB_PARENT_ARCHIVE_AREAS}; then
# Manually add firmware-linux/non-free-firmware meta package
if [ "${LB_DERIVATIVE}" = "false" ] && In_list "non-free-firmware" ${LB_PARENT_ARCHIVE_AREAS}; then
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
elif [ "${LB_DERIVATIVE}" = "false" ] && In_list "non-free" ${LB_PARENT_ARCHIVE_AREAS}; then
# Buster and older
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
fi
@ -83,6 +86,9 @@ then
fi
fi
# Ensure that the package file exists before it is manipulated
touch chroot/root/packages.chroot
# Drop section and keep package names only
for _PACKAGE in ${FIRMWARE_PACKAGES}
do
@ -90,13 +96,17 @@ do
done
# Some known licenses required to be accepted
if In_list "non-free" ${LB_PARENT_ARCHIVE_AREAS}; then
if grep --silent "^firmware-ivtv$" chroot/root/packages.chroot
then
cat >> chroot/root/packages.chroot.cfg << EOF
firmware-ivtv firmware-ivtv/license/accepted boolean true
EOF
fi
if grep --silent "^firmware-ipw2x00$" chroot/root/packages.chroot
then
cat >> chroot/root/packages.chroot.cfg << EOF
firmware-ipw2x00 firmware-ipw2x00/license/accepted boolean true
EOF
fi
# Creating stage file

View File

@ -402,7 +402,10 @@ then
FIRMWARE_PACKAGES=""
# Manually add firmware-linux/non-free meta package
if [ "${LB_DERIVATIVE}" = "false" ] && In_list "non-free" ${LB_PARENT_ARCHIVE_AREAS}; then
if [ "${LB_DERIVATIVE}" = "false" ] && In_list "non-free-firmware" ${LB_PARENT_ARCHIVE_AREAS}; then
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
elif [ "${LB_DERIVATIVE}" = "false" ] && In_list "non-free" ${LB_PARENT_ARCHIVE_AREAS}; then
# Buster and older
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
fi

View File

@ -119,6 +119,14 @@ parse_commandline_arguments() {
exit 2
fi
DEBIAN_VERSION="$2"
case "$DEBIAN_VERSION" in
"bullseye")
FIRMWARE_ARCHIVE_AREA="non-free"
;;
*)
FIRMWARE_ARCHIVE_AREA="non-free-firmware"
;;
esac
# Argument 3 = optional timestamp
BUILD_LATEST="archive"
@ -287,6 +295,7 @@ lb config \
--debian-installer ${INSTALLER} \
--debian-installer-distribution ${INSTALLER_ORIGIN} \
--cache-packages false \
--archive-areas "main ${FIRMWARE_ARCHIVE_AREA}" \
2>&1 | tee $LB_OUTPUT
# Insider knowledge of live-build: