2011-02-05 08:42:04 -01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-06-10 13:33:56 +00:00
|
|
|
# Work out which firmware files to include in the image
|
|
|
|
# Several steps:
|
|
|
|
#
|
|
|
|
# 1. Look for packages which contain "firmware" or "microcode" in their package names
|
|
|
|
# 2. Check each of those packages to see if they contain files in /lib/firmware
|
|
|
|
# 3. For those that do, add them into the firmware temp tree
|
|
|
|
# 4. Make images (tar.gz, zip) of that tree
|
|
|
|
|
2011-02-05 08:42:04 -01:00
|
|
|
set -e
|
|
|
|
|
|
|
|
MIRROR=$1
|
|
|
|
SUITE=$2
|
|
|
|
TMPDIR=$3
|
|
|
|
export LC_ALL=C
|
|
|
|
|
|
|
|
if [ "$MIRROR"x = ""x ] || \
|
|
|
|
[ "$SUITE"x = ""x ] || \
|
2011-06-10 13:33:56 +00:00
|
|
|
[ "$TMPDIR"x = ""x ] ; then
|
2011-02-05 08:42:04 -01:00
|
|
|
echo "$0: Need parameters"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf $TMPDIR/firmware
|
|
|
|
mkdir -p $TMPDIR/firmware
|
|
|
|
|
2011-06-10 13:33:56 +00:00
|
|
|
FILES=`zcat ${MIRROR}/dists/${SUITE}/*/binary-*/Packages.gz | \
|
2011-06-10 16:51:52 +00:00
|
|
|
grep-dctrl -Pe '.*(firmware|microcode).*' -s Filename -n | sort -u`
|
2011-02-05 08:42:04 -01:00
|
|
|
|
2011-06-10 13:33:56 +00:00
|
|
|
for FILE in $FILES; do
|
|
|
|
# Don't use "grep -q" here, it causes errors from tar
|
|
|
|
if (dpkg --contents ${MIRROR}/${FILE} | grep " ./lib/firmware/" >/dev/null) ; then
|
|
|
|
cp ${MIRROR}/${FILE} $TMPDIR/firmware
|
|
|
|
fi
|
|
|
|
done
|
2011-02-05 08:42:04 -01:00
|
|
|
|
|
|
|
cd $TMPDIR/firmware
|
|
|
|
tar czf ../firmware.tar.gz .
|
|
|
|
zip -9rq ../firmware.zip .
|
|
|
|
cd ..
|
2015-10-07 14:45:30 +00:00
|
|
|
find firmware | cpio --quiet -o -H newc | gzip -9 > firmware.cpio.gz
|
|
|
|
ls -l $PWD/firmware.cpio.gz $PWD/firmware.tar.gz $PWD/firmware.zip
|
|
|
|
|
2015-10-07 15:29:01 +00:00
|
|
|
md5sum firmware.* > MD5SUMS
|
|
|
|
sha1sum firmware.* > SHA1SUMS
|
|
|
|
sha256sum firmware.* > SHA256SUMS
|
|
|
|
sha512sum firmware.* > SHA512SUMS
|