wok-current annotate linux/stuff/list_modules.sh @ rev 22229
Up chkrootkit (0.53)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Nov 11 22:57:56 2019 +0100 (2019-11-11) |
parents | 31ece15b363f |
children |
rev | line source |
---|---|
pascal@886 | 1 #!/bin/sh |
pascal@886 | 2 # list_modules.sh: list Linux kernel modules for SliTaz GNU/Linux. |
pascal@886 | 3 # 2008/06/07 <pascal.bellard@slitaz.org> - GNU General Public License. |
pascal@886 | 4 # |
pascal@886 | 5 |
pankso@15855 | 6 find_modules() { |
pascal@17030 | 7 find $install/lib/modules/*-slitaz*/kernel/$1 -type f -exec basename {} \; |
pascal@4269 | 8 } |
pascal@4269 | 9 |
pascal@886 | 10 if [ -z "$1" ] ; then |
pascal@886 | 11 cat 1>&2 <<EOT |
pascal@886 | 12 |
pascal@886 | 13 \033[1musage:\033[0m `basename $0` path/to/kernel-modules-subtrees |
pascal@886 | 14 exemple `basename $0` drivers/net/wireless >list |
pascal@886 | 15 |
pascal@886 | 16 EOT |
pascal@886 | 17 exit 1 |
pascal@886 | 18 fi |
pascal@886 | 19 |
pascal@17030 | 20 if [ -z "$(ls -d $install/lib/modules/*-slitaz*/kernel/$1 2> /dev/null)" ] ; then |
pascal@886 | 21 cat 1>&2 <<EOT |
pascal@886 | 22 |
pascal@886 | 23 Error : $1 does not exist. |
pascal@886 | 24 |
pascal@886 | 25 EOT |
pascal@886 | 26 exit 1 |
pascal@886 | 27 fi |
pascal@886 | 28 |
pascal@886 | 29 for tree in $@; do |
pascal@4269 | 30 for module in $(find_modules $tree) ; do |
pascal@17030 | 31 grep /$module: $install/lib/modules/*-slitaz*/modules.dep || |
pascal@17030 | 32 find $install/lib/modules/*-slitaz*/kernel/$tree -name $module |
pascal@886 | 33 done | awk '{ for (i = 1; i <= NF; i++) print $i; }' |
pascal@17036 | 34 done | sort | uniq | sed -e 's,.*slitaz[64]*/,,' -e 's,^kernel/,,' -e 's/:$//' | \ |
pascal@886 | 35 while read module; do |
pascal@13576 | 36 grep -qs ^$module$ $src/../tmp/modules.list && continue |
pascal@17030 | 37 if [ ! -f $install/lib/modules/*-slitaz*/kernel/$module ]; then |
pascal@17030 | 38 (cd $install/lib/modules/*-slitaz*/kernel; find -name $(basename $module) ) |
pascal@4270 | 39 else |
pascal@4270 | 40 echo $module |
pascal@4270 | 41 fi |
pascal@886 | 42 done |