wok-4.x view linux/stuff/list_modules.sh @ rev 1692

Add: get-OpenOffice3.sh
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Tue Nov 11 12:20:46 2008 +0100 (2008-11-11)
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