56 lines
1.4 KiB
Bash
Executable File
56 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Work out which firmware files to include in the image
|
|
# Several steps:
|
|
#
|
|
# 1. Look for firmware packages just like a regular debian-cd build with
|
|
# non-free enabled would do (see NONFREE_COMPONENTS variable for details)
|
|
# 2. Add them into the firmware temp tree
|
|
# 3. Make images (tar.gz, zip) of that tree
|
|
|
|
set -e
|
|
|
|
export MIRROR=$1
|
|
export CODENAME=$2
|
|
TMPDIR=$3
|
|
export LC_ALL=C
|
|
|
|
if [ "$MIRROR"x = ""x ] || \
|
|
[ "$CODENAME"x = ""x ] || \
|
|
[ "$TMPDIR"x = ""x ] ; then
|
|
echo "$0: Need parameters"
|
|
exit 1
|
|
fi
|
|
|
|
rm -rf $TMPDIR/firmware
|
|
mkdir -p $TMPDIR/firmware
|
|
|
|
# Debian 12+ official images use main and non-free-firmware, Debian 11
|
|
# 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
|
|
cp ${MIRROR}/${FILE} $TMPDIR/firmware
|
|
done
|
|
|
|
cd $TMPDIR/firmware
|
|
tar czf ../firmware.tar.gz .
|
|
zip -9rq ../firmware.zip .
|
|
cd ..
|
|
find firmware | cpio --quiet -o -H newc | pigz -9nm > firmware.cpio.gz
|
|
ls -l $PWD/firmware.cpio.gz $PWD/firmware.tar.gz $PWD/firmware.zip
|
|
|
|
sha256sum firmware.* > SHA256SUMS
|
|
sha512sum firmware.* > SHA512SUMS
|