2008-06-23 21:55:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-06-10 13:26:30 +00:00
|
|
|
# Work out which firmware files to include in the image
|
|
|
|
# Several steps:
|
|
|
|
#
|
2023-01-26 21:22:40 -01:00
|
|
|
# 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
|
2011-06-10 13:26:30 +00:00
|
|
|
|
2008-06-23 21:55:36 +00:00
|
|
|
set -e
|
|
|
|
|
2023-01-26 21:22:40 -01:00
|
|
|
export MIRROR=$1
|
|
|
|
export CODENAME=$2
|
2008-06-23 21:55:36 +00:00
|
|
|
TMPDIR=$3
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2008-06-25 00:24:09 +00:00
|
|
|
if [ "$MIRROR"x = ""x ] || \
|
2023-01-26 21:22:40 -01:00
|
|
|
[ "$CODENAME"x = ""x ] || \
|
2011-06-10 13:26:30 +00:00
|
|
|
[ "$TMPDIR"x = ""x ] ; then
|
2008-06-23 21:55:36 +00:00
|
|
|
echo "$0: Need parameters"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf $TMPDIR/firmware
|
|
|
|
mkdir -p $TMPDIR/firmware
|
|
|
|
|
2023-01-26 21:22:40 -01:00
|
|
|
# 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)
|
2011-06-10 13:26:30 +00:00
|
|
|
for FILE in $FILES; do
|
2023-01-26 21:22:40 -01:00
|
|
|
cp ${MIRROR}/${FILE} $TMPDIR/firmware
|
2011-06-10 13:26:30 +00:00
|
|
|
done
|
2008-06-23 21:55:36 +00:00
|
|
|
|
|
|
|
cd $TMPDIR/firmware
|
|
|
|
tar czf ../firmware.tar.gz .
|
2008-06-23 21:57:37 +00:00
|
|
|
zip -9rq ../firmware.zip .
|
|
|
|
cd ..
|
2023-01-23 17:30:35 -01:00
|
|
|
find firmware | cpio --quiet -o -H newc | pigz -9nm > firmware.cpio.gz
|
2015-08-21 09:53:44 +00:00
|
|
|
ls -l $PWD/firmware.cpio.gz $PWD/firmware.tar.gz $PWD/firmware.zip
|
2015-10-07 14:36:22 +00:00
|
|
|
|
2015-10-07 15:28:19 +00:00
|
|
|
sha256sum firmware.* > SHA256SUMS
|
|
|
|
sha512sum firmware.* > SHA512SUMS
|