wok-next diff linux-libre/stuff/list_modules.sh @ rev 11105

Up: fetchmail to 6.3.21.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Oct 17 03:03:43 2011 +0000 (2011-10-17)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux-libre/stuff/list_modules.sh	Mon Oct 17 03:03:43 2011 +0000
     1.3 @@ -0,0 +1,43 @@
     1.4 +#!/bin/sh
     1.5 +# list_modules.sh: list Linux kernel modules for SliTaz GNU/Linux.
     1.6 +# 2008/06/07 <pascal.bellard@slitaz.org> - GNU General Public License.
     1.7 +#
     1.8 +
     1.9 +find_modules()
    1.10 +{
    1.11 +find $_pkg/lib/modules/*-slitaz/kernel/$1 -type f -exec basename {} \;
    1.12 +}
    1.13 +
    1.14 +if [ -z "$1" ] ; then
    1.15 +  cat 1>&2 <<EOT
    1.16 +  
    1.17 +\033[1musage:\033[0m `basename $0` path/to/kernel-modules-subtrees
    1.18 +exemple `basename $0` drivers/net/wireless >list
    1.19 +
    1.20 +EOT
    1.21 +  exit 1
    1.22 +fi
    1.23 +
    1.24 +if [ -z "$(ls -d $_pkg/lib/modules/*-slitaz/kernel/$1 2> /dev/null)" ] ; then
    1.25 +  cat 1>&2 <<EOT
    1.26 +  
    1.27 +Error : $1 does not exist.
    1.28 +
    1.29 +EOT
    1.30 +  exit 1
    1.31 +fi
    1.32 +
    1.33 +for tree in $@; do
    1.34 +    for module in $(find_modules $tree) ; do
    1.35 +        grep /$module: $_pkg/lib/modules/*-slitaz/modules.dep ||
    1.36 +        find $_pkg/lib/modules/*-slitaz/kernel/$tree -name $module
    1.37 +    done | awk '{ for (i = 1; i <= NF; i++)  print $i; }'
    1.38 +done | sort | uniq | sed -e 's,.*slitaz/,,' -e 's,^kernel/,,' -e 's/:$//' | \
    1.39 +while read module; do
    1.40 +    grep -qs ^$module$ $src/modules.list && continue
    1.41 +    if [ ! -f $_pkg/lib/modules/*-slitaz/kernel/$module ]; then
    1.42 +	(cd $_pkg/lib/modules/*-slitaz/kernel; find -name $(basename $module) )
    1.43 +    else
    1.44 +        echo $module
    1.45 +    fi
    1.46 +done