wok-next view linux-libre/stuff/check_modules.sh @ rev 15833
transmission: update receipt
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Fri Jan 24 14:07:17 2014 +0000 (2014-01-24) |
parents | d51bf7b42b2a |
children |
line source
1 #!/bin/sh
2 # Echo any module in kernel .config that's not added to one of linux-libre-* pkgs
3 # (c) SliTaz - GNU General Public License.
4 # 20090618 <jozee@slitaz.org>
5 # 20100528 <pankso@slitaz.org>
6 #
7 #. /etc/slitaz/slitaz.conf
9 #WOK=$LOCAL_REPOSITORY/wok
10 WOK=$(cd `dirname $0` && pwd | sed 's/wok.*/wok/')
11 VERSION=`grep ^VERSION= $WOK/linux-libre/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
12 src="$WOK/linux-libre/source/linux-libre-$VERSION"
14 cd $src
15 tmp=$WOK/${PACKAGE:-linux-libre}/tmp
16 mkdir -p $tmp 2>/dev/null
17 rm -f $tmp/*
19 echo -e "\nChecking for modules selected in .config but not in linux-libre-* pkgs"
20 echo "======================================================================"
22 # create a packaged modules list
23 cat $WOK/linux-libre/stuff/modules-"$VERSION".list >> $tmp/pkgs-modules-"$VERSION".list
25 for i in $(cd $WOK; grep -l '^WANTED="linux-libre"' */receipt | sed 's|/receipt||g')
26 do
27 tazpath="taz/$i-*"
28 for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko..z")
29 do
30 basename $j >> $tmp/pkgs-modules-"$VERSION".list
31 done
32 done
33 # get the original list in .config
34 for i in $(find $_pkg -iname "*.ko.?z")
35 do
36 basename $i
37 done > $tmp/original-"$VERSION".list
38 # compare original .config and pkged modules
39 for i in $(cat $tmp/original-$VERSION.list)
40 do
41 if ! grep -qs "$i" $tmp/pkgs-modules-"$VERSION".list ; then
42 modpath=`find $_pkg -iname "$i"`
43 echo "Orphan module: $i"
44 echo "$i : $modpath" >> $tmp/unpackaged-modules-"$VERSION".list
45 fi
46 done
47 if [ -f $tmp/unpackaged-modules-"$VERSION".list ]; then
48 echo "======================================================================"
49 echo -e "Check linux-libre/tmp/unpackaged-modules-$VERSION.list for mod path\n"
50 else
51 echo -e "\nAll modules are packaged\n"
52 echo "======================================================================"
53 echo ""
54 rm -rf $tmp
55 fi