3 # Find all duplicate or obsolete firmware that is being carried
4 # in the kernel firmware directory. Compare these files against
5 # the linux-firmware package for the approriate release. For example,
6 # assuming this is raring, then compare the kernel firmware files
7 # against the raring branch of linux-firmware.
9 # Example: $0 ~/ubuntu/linux-firmware-raring
11 USEAGE
="$0 LINUX-FIRMWARE"
15 NFWINFO
="`find $DEBIAN -name fwinfo|wc -l`"
16 if [ ! "$NFWINFO" = "1" ]
18 echo Your repo is hosed. There can only be one fwinfo
file.
19 find $DEBIAN -name fwinfo
23 FWINFO
="`pwd`/`find $DEBIAN -name fwinfo`"
32 if [ ! -f $FW/WHENCE
]
34 echo Bogus linux-firmware directory
37 if ! egrep -q "^firmware:" $FWINFO
39 echo Bogus firmware info
file
44 # Prepare the tree and make firmware.
49 rm -rf debian
/build
$LF $LO
50 fakeroot debian
/rules clean prepare-generic
51 cp debian
/build
/build-generic
/.config .
53 make firmware_install INSTALL_MOD_PATH
=`pwd`
56 find .
-type f |
while read f
60 if ! grep -q $BN $FWINFO
62 echo "Unused firmware: $f" |
$TEE $LO
68 echo "$f differs" |
$TEE $LO
70 echo "$f is duplicated" |
$TEE $LO
73 echo "$f does not exist in $FW" |
$TEE $LO
79 # Check for firmware files referenced by the kernel
80 # that do not exist in either location.
82 cat $FWINFO |
while read fwi f
88 echo "Missing firmware $f" |
$TEE $LO