wok-next diff linux-libre/stuff/check_modules.sh @ rev 9402
git: fix genpkg_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Mar 27 16:56:58 2011 +0200 (2011-03-27) |
parents | |
children | 903c03d31ebf |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/linux-libre/stuff/check_modules.sh Sun Mar 27 16:56:58 2011 +0200 1.3 @@ -0,0 +1,54 @@ 1.4 +#!/bin/sh 1.5 +# Echo any module in kernel .config that's not added to one of linux-libre-* pkgs 1.6 +# (c) SliTaz - GNU General Public License. 1.7 +# 20090618 <jozee@slitaz.org> 1.8 +# 20100528 <pankso@slitaz.org> 1.9 +# 1.10 +#. /etc/slitaz/slitaz.conf 1.11 + 1.12 +#WOK=$LOCAL_REPOSITORY/wok 1.13 +WOK=$(cd `dirname $0` && pwd | sed 's/wok.*/wok/') 1.14 +VERSION=`grep ^VERSION= $WOK/linux-libre/receipt | cut -d "=" -f2 | sed -e 's/"//g'` 1.15 +src="$WOK/linux-libre/linux-$VERSION" 1.16 + 1.17 +cd $src 1.18 +mkdir -p $WOK/$PACKAGE/tmp 1.19 +rm -f $WOK/$PACKAGE/tmp/* 1.20 + 1.21 +echo -e "\nChecking for modules selected in .config but not in linux-libre-* pkgs" 1.22 +echo "======================================================================" 1.23 + 1.24 +# create a packaged modules list 1.25 +cat ../stuff/modules-"$VERSION".list >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list 1.26 + 1.27 +for i in $(cd $WOK; ls -d linux-libre-*) 1.28 +do 1.29 + tazpath="taz/$i-$VERSION" 1.30 + for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz") 1.31 + do 1.32 + basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list 1.33 + done 1.34 +done 1.35 +# get the original list in .config 1.36 +for i in $(find $_pkg -iname "*.ko.gz") 1.37 +do 1.38 + basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list 1.39 +done 1.40 +# compare original .config and pkged modules 1.41 +for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list) 1.42 +do 1.43 + if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then 1.44 + modpath=`find $_pkg -iname "$i"` 1.45 + echo "Orphan module: $i" 1.46 + echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list 1.47 + fi 1.48 +done 1.49 +if [ -f $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list ]; then 1.50 + echo "======================================================================" 1.51 + echo -e "Check linux-libre/tmp/unpackaged-modules-$VERSION.list for mod path\n" 1.52 +else 1.53 + echo -e "\nAll modules are packaged\n" 1.54 + echo "======================================================================" 1.55 + echo "" 1.56 + rm -rf $WOK/$PACKAGE/tmp 1.57 +fi