wok-current view linux/stuff/check_modules.sh @ rev 9117
scim-tables-additional: remove spurrious part of genpkg_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 05 13:01:38 2011 +0100 (2011-03-05) |
parents | 1d89aa1672da |
children | 2010b1abc210 |
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 src="$WOK/linux/linux-$VERSION"
14 cd $src
15 mkdir -p $WOK/$PACKAGE/tmp
16 rm -f $WOK/$PACKAGE/tmp/*
18 echo -e "\nChecking for modules selected in .config but not in linux-* pkgs"
19 echo "======================================================================"
21 # create a packaged modules list
22 cat ../stuff/modules-"$VERSION".list >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list
24 for i in $(cd $WOK; ls -d linux-*)
25 do
26 tazpath="taz/$i-$VERSION"
27 for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz")
28 do
29 basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list
30 done
31 done
32 # get the original list in .config
33 for i in $(find $_pkg -iname "*.ko.gz")
34 do
35 basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list
36 done
37 # compare original .config and pkged modules
38 for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list)
39 do
40 if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then
41 modpath=`find $_pkg -iname "$i"`
42 echo "Orphan module: $i"
43 echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list
44 fi
45 done
46 if [ -f $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list ]; then
47 echo "======================================================================"
48 echo -e "Check linux/tmp/unpackaged-modules-$VERSION.list for mod path\n"
49 else
50 echo -e "\nAll modules are packaged\n"
51 echo "======================================================================"
52 echo ""
53 rm -rf $WOK/$PACKAGE/tmp
54 fi