]>
Commit | Line | Data |
---|---|---|
0d34a427 LO |
1 | #!/bin/bash |
2 | # | |
3 | # Find all files in linux-firmware that are new or different since the previous release | |
4 | # and copy them into the kernel firmware directory. You should only do this on the | |
5 | # backport branch since it would be redundant on the released kernel. It assumed you've | |
6 | # unpacked linux-firmware from each release into separate directories. | |
7 | # | |
8 | # Example: $0 ~/ubuntu/linux-firmware-precise ~/ubuntu/linux-firmware-quantal | |
9 | ||
10 | if [ "$1" = "" ] || [ "$2" = "" ] || [ ! -f $1/WHENCE ] || [ ! -f $2/WHENCE ] | |
11 | then | |
12 | echo You must supply 2 firmware directories. | |
13 | exit 1 | |
14 | fi | |
15 | ||
16 | if [ ! -f debian/debian.env ] | |
17 | then | |
18 | echo You must run this script from the root of the repo | |
19 | exit 1 | |
20 | fi | |
21 | . debian/debian.env | |
22 | ||
23 | NFWINFO="`find $DEBIAN -name fwinfo|wc -l`" | |
24 | if [ ! "$NFWINFO" = "1" ] | |
25 | then | |
26 | echo Your repo is hosed. There can only be one fwinfo file. | |
27 | find $DEBIAN -name fwinfo | |
28 | exit 1 | |
29 | fi | |
30 | ||
31 | FWINFO="`pwd`/`find $DEBIAN -name fwinfo`" | |
32 | ||
33 | CDIR=`pwd` | |
34 | OFW=$1 | |
35 | NFW=$2 | |
36 | ||
37 | cd $NFW | |
38 | # | |
39 | # Find all files in $NFW that are new or different from $1 | |
40 | # | |
41 | (find . -type f | egrep -v "debian|git|LICEN|WHEN|READ|Make|configure" | sed 's;\./;;' | \ | |
42 | while read f | |
43 | do | |
44 | if grep -q $f $FWINFO | |
45 | then | |
46 | if [ ! -f $OFW/$f ] | |
47 | then | |
48 | echo $f | |
49 | elif ! cmp $f $OFW/$f > /dev/null | |
50 | then | |
51 | echo $f | |
52 | fi | |
53 | fi | |
54 | done) |\ | |
55 | while read f | |
56 | do | |
57 | mkdir -p $CDIR/firmware/`dirname $f` | |
58 | if [ ! -f $CDIR/firmware/`dirname $f`/`basename $f`.ihex ] | |
59 | then | |
60 | cp -v $f $CDIR/firmware/`dirname $f` | |
61 | fi | |
62 | done |