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