wok-6.x view linux/stuff/check_modules.sh @ rev 18890
Up cookutils (793), tazpanel (566)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 12 16:05:17 2016 +0100 (2016-02-12) |
parents | 4371e2f99088 |
children |
line source
1 #!/bin/sh
2 # Echo any module in kernel .config that's not added to one of linux-* pkgs
3 # (c) 2009-2014 SliTaz - GNU General Public License.
4 #
6 WOK=$(cd `dirname $0` && pwd | sed 's/wok.*/wok/')
7 VERSION=$(grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g')
8 BASEVER="${VERSION:0:3}"
9 src="$WOK/linux/source/linux-$VERSION"
11 cd $src
12 tmp=$WOK/${PACKAGE:-linux}/tmp
13 mkdir -p $tmp 2>/dev/null
14 rm -f $tmp/*
16 echo -e "\nChecking for modules selected in .config but not in linux-* pkgs"
17 echo "======================================================================"
19 # create a packaged modules list
20 cat $WOK/linux/stuff/modules.list >> $tmp/pkgs-modules-"$VERSION".list
22 for i in $(cd $WOK; grep -l '^WANTED="linux"' */receipt | sed 's|/receipt||g')
23 do
24 tazpath="taz/$i-*"
25 if [ ! $(grep -l 'linux-libre' $WOK/$i/receipt) ]; then
26 for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko..z")
27 do
28 basename $j >> $tmp/pkgs-modules-"$VERSION".list
29 done
30 fi
31 done
32 # get the original list in .config
33 for i in $(find $install -iname "*.ko.?z")
34 do
35 basename $i
36 done > $tmp/original-"$VERSION".list
37 # compare original .config and pkged modules
38 for i in $(cat $tmp/original-$VERSION.list)
39 do
40 if ! grep -qs "$i" $tmp/pkgs-modules-"$VERSION".list ; then
41 modpath=`find $install -iname "$i"`
42 echo "Orphan module: $i"
43 echo "$i : $modpath" >> $tmp/unpackaged-modules-"$VERSION".list
44 fi
45 done
46 if [ -f $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 $tmp
54 fi