wok-stable view linux/stuff/check_modules.sh @ rev 12459
lives: fix symlink (thanks I-Jurij)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Apr 28 08:19:20 2017 +0200 (2017-04-28) |
parents | 2010b1abc210 |
children |
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 if [ ! $(grep -l 'linux-libre' $WOK/$i/receipt) ]; then
28 for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz")
29 do
30 basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list
31 done
32 fi
33 done
34 # get the original list in .config
35 for i in $(find $_pkg -iname "*.ko.gz")
36 do
37 basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list
38 done
39 # compare original .config and pkged modules
40 for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list)
41 do
42 if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then
43 modpath=`find $_pkg -iname "$i"`
44 echo "Orphan module: $i"
45 echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list
46 fi
47 done
48 if [ -f $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list ]; then
49 echo "======================================================================"
50 echo -e "Check linux/tmp/unpackaged-modules-$VERSION.list for mod path\n"
51 else
52 echo -e "\nAll modules are packaged\n"
53 echo "======================================================================"
54 echo ""
55 rm -rf $WOK/$PACKAGE/tmp
56 fi