wok-current view linux/stuff/check_modules.sh @ rev 13043
visualboyadvance: fix compile_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jun 15 16:18:05 2012 +0200 (2012-06-15) |
parents | 973f4b50dcf3 |
children | edd6117a0e47 |
line source
1 #!/bin/sh
2 # Echo any module in kernel .config that's not added to one of linux-* 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/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
12 BASEVER="${VERSION:0:3}"
13 src="$WOK/linux/source/linux-$VERSION"
15 cd $src
16 mkdir -p $WOK/$PACKAGE/tmp 2>/dev/null
17 rm -f $WOK/$PACKAGE/tmp/*
19 echo -e "\nChecking for modules selected in .config but not in linux-* pkgs"
20 echo "======================================================================"
22 # create a packaged modules list
23 cat $WOK/linux/stuff/modules.list >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list
25 for i in $(cd $WOK; grep -l '^WANTED="linux"' */receipt | sed 's|/receipt||g')
26 do
27 tazpath="taz/$i-*"
28 if [ ! $(grep -l 'linux-libre' $WOK/$i/receipt) ]; then
29 for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz")
30 do
31 basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list
32 done
33 fi
34 done
35 # get the original list in .config
36 for i in $(find $_pkg -iname "*.ko.gz")
37 do
38 basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list
39 done
40 # compare original .config and pkged modules
41 for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list)
42 do
43 if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then
44 modpath=`find $_pkg -iname "$i"`
45 echo "Orphan module: $i"
46 echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list
47 fi
48 done
49 if [ -f $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list ]; then
50 echo "======================================================================"
51 echo -e "Check linux/tmp/unpackaged-modules-$VERSION.list for mod path\n"
52 else
53 echo -e "\nAll modules are packaged\n"
54 echo "======================================================================"
55 echo ""
56 rm -rf $WOK/$PACKAGE/tmp
57 fi