wok-current view linux/stuff/check_modules.sh @ rev 8571

imported patch get/pcsxr-svn
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sun Feb 13 22:57:56 2011 +0100 (2011-02-13)
parents 3fe781270709
children 1d89aa1672da
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 WOK=$(cd `basedir $0` && pwd | sed 's/wok.*/wok/')
8 VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
9 src="$WOK/linux/linux-$VERSION"
11 cd $src
12 mkdir -p ../tmp
13 rm -f ../tmp/*
15 echo -e "\nChecking for modules selected in .config but not in linux-* pkgs"
16 echo "======================================================================"
18 # create a packaged modules list
19 cat ../stuff/modules-"$VERSION".list >> ../tmp/pkgs-modules-"$VERSION".list
21 for i in $(cd $WOK; ls -d linux-*)
22 do
23 tazpath="taz/$i-$VERSION"
24 for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz")
25 do
26 basename $j >> ../tmp/pkgs-modules-"$VERSION".list
27 done
28 done
29 # get the original list in .config
30 for i in $(find $_pkg -iname "*.ko.gz")
31 do
32 basename $i >> ../tmp/originial-"$VERSION".list
33 done
34 # compare original .config and pkged modules
35 for i in $(cat ../tmp/originial-$VERSION.list)
36 do
37 if ! grep -qs "$i" ../tmp/pkgs-modules-"$VERSION".list ; then
38 modpath=`find $_pkg -iname "$i"`
39 echo "Orphan module: $i"
40 echo "$i : $modpath" >> ../tmp/unpackaged-modules-"$VERSION".list
41 fi
42 done
43 if [ -f ../tmp/unpackaged-modules-"$VERSION".list ]; then
44 echo "======================================================================"
45 echo -e "Check linux/tmp/unpackaged-modules-$VERSION.list for mod path\n"
46 else
47 echo -e "\nAll modules are packaged\n"
48 echo "======================================================================"
49 echo ""
50 rm -rf ../tmp
51 fi