wok-current view linux/stuff/list_modules.sh @ rev 3804
Add xplanet
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Aug 05 13:38:51 2009 +0200 (2009-08-05) |
parents | b563b08e4f32 |
children | 720fade32b40 |
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/,,' -e 's,^kernel/,,' -e 's/:$//' | \
32 while read module; do
33 grep -qs ^$module$ $src/modules.list && continue
34 echo $module
35 done