wok annotate linux/stuff/list_modules.sh @ rev 1032

linux: more crypto modules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jul 11 07:45:28 2008 +0000 (2008-07-11)
parents 04b68c6ffdfa
children 0f29c565427b
rev   line source
pascal@886 1 #!/bin/sh
pascal@886 2 # list_modules.sh: list Linux kernel modules for SliTaz GNU/Linux.
pascal@886 3 # 2008/06/07 <pascal.bellard@slitaz.org> - GNU General Public License.
pascal@886 4 #
pascal@886 5
pascal@886 6 if [ -z "$1" ] ; then
pascal@886 7 cat 1>&2 <<EOT
pascal@886 8
pascal@886 9 \033[1musage:\033[0m `basename $0` path/to/kernel-modules-subtrees
pascal@886 10 exemple `basename $0` drivers/net/wireless >list
pascal@886 11
pascal@886 12 EOT
pascal@886 13 exit 1
pascal@886 14 fi
pascal@886 15
pascal@1032 16 if [ -z "$(ls -d $_pkg/lib/modules/*-slitaz/kernel/$1 2> /dev/null)" ] ; then
pascal@886 17 cat 1>&2 <<EOT
pascal@886 18
pascal@886 19 Error : $1 does not exist.
pascal@886 20
pascal@886 21 EOT
pascal@886 22 exit 1
pascal@886 23 fi
pascal@886 24
pascal@886 25 for tree in $@; do
pascal@886 26 for module in $(find $_pkg/lib/modules/*-slitaz/kernel/$tree \
pascal@886 27 -type f -exec basename {} \;) ; do
pascal@886 28 grep /$module: $_pkg/lib/modules/*-slitaz/modules.dep
pascal@886 29 done | awk '{ for (i = 1; i <= NF; i++) print $i; }'
pascal@886 30 done | sort | uniq | sed -e 's,.*slitaz/kernel/,,' -e 's/:$//' | \
pascal@886 31 while read module; do
pascal@886 32 grep -qs ^$module$ $src/modules.list && continue
pascal@886 33 echo $module
pascal@886 34 done