wok-6.x view linux/stuff/list_modules.sh @ rev 2255
Add squirrelmail-msg_flags
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Feb 15 22:52:03 2009 +0000 (2009-02-15) |
parents | ff4745b2e54a |
children | b563b08e4f32 |
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 find $_pkg/lib/modules/*-slitaz/kernel/$tree -name $module
30 done | awk '{ for (i = 1; i <= NF; i++) print $i; }'
31 done | sort | uniq | sed -e 's,.*slitaz/kernel/,,' -e 's/:$//' | \
32 while read module; do
33 grep -qs ^$module$ $src/modules.list && continue
34 echo $module
35 done