make-firmware-image: use generate_firmware_task to find firmware
Since that tool might be used without a caller that sources CONF.sh, be explicit about the components in which firmware packages must be searched: - use "main contrib non-free" for bullseye; - use "main non-free non-free-firmware" for bookworm and above. non-free can go away once we have all we need in non-free-firmware. Export some environment variables for generate_firmware_task (also renaming SUITE to CODENAME).
This commit is contained in:
parent
bd13392570
commit
a2c722b735
|
@ -3,20 +3,20 @@
|
||||||
# Work out which firmware files to include in the image
|
# Work out which firmware files to include in the image
|
||||||
# Several steps:
|
# Several steps:
|
||||||
#
|
#
|
||||||
# 1. Look for packages which contain "firmware" or "microcode" in their package names
|
# 1. Look for firmware packages just like a regular debian-cd build with
|
||||||
# 2. Check each of those packages to see if they contain files in /lib/firmware
|
# non-free enabled would do (see NONFREE_COMPONENTS variable for details)
|
||||||
# 3. For those that do, add them into the firmware temp tree
|
# 2. Add them into the firmware temp tree
|
||||||
# 4. Make images (tar.gz, zip) of that tree
|
# 3. Make images (tar.gz, zip) of that tree
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
MIRROR=$1
|
export MIRROR=$1
|
||||||
SUITE=$2
|
export CODENAME=$2
|
||||||
TMPDIR=$3
|
TMPDIR=$3
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
if [ "$MIRROR"x = ""x ] || \
|
if [ "$MIRROR"x = ""x ] || \
|
||||||
[ "$SUITE"x = ""x ] || \
|
[ "$CODENAME"x = ""x ] || \
|
||||||
[ "$TMPDIR"x = ""x ] ; then
|
[ "$TMPDIR"x = ""x ] ; then
|
||||||
echo "$0: Need parameters"
|
echo "$0: Need parameters"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -25,14 +25,23 @@ fi
|
||||||
rm -rf $TMPDIR/firmware
|
rm -rf $TMPDIR/firmware
|
||||||
mkdir -p $TMPDIR/firmware
|
mkdir -p $TMPDIR/firmware
|
||||||
|
|
||||||
FILES=`$BASEDIR/tools/catz ${MIRROR}/dists/${SUITE}/*/binary-*/Packages.*z* | \
|
# Debian 12+ official images use main and non-free-firmware, Debian 11
|
||||||
grep-dctrl -Pe '.*(firmware|microcode).*' -s Filename -n | sort -u`
|
# sticks to the three historical components:
|
||||||
|
case $CODENAME in
|
||||||
|
bullseye)
|
||||||
|
export FIRMWARE_COMPONENTS="main contrib non-free"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# FIXME: drop non-free when we no longer need it
|
||||||
|
export FIRMWARE_COMPONENTS="main non-free non-free-firmware"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# This tool requires environment variables (exported earlier) and two
|
||||||
|
# parameters; the second one has a special value for us to use:
|
||||||
|
FILES=$($BASEDIR/tools/generate_firmware_task '*' --list-filenames)
|
||||||
for FILE in $FILES; do
|
for FILE in $FILES; do
|
||||||
# Don't use "grep -q" here, it causes errors from tar
|
cp ${MIRROR}/${FILE} $TMPDIR/firmware
|
||||||
if (dpkg --contents ${MIRROR}/${FILE} | grep " ./lib/firmware/" >/dev/null) ; then
|
|
||||||
cp ${MIRROR}/${FILE} $TMPDIR/firmware
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
cd $TMPDIR/firmware
|
cd $TMPDIR/firmware
|
||||||
|
|
Loading…
Reference in New Issue