wok-4.x view linux/stuff/list_modules.sh @ rev 3112
lxpanel: Use custom background
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 18 02:37:18 2009 +0200 (2009-05-18) |
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