wok-current rev 4269

linux: list_modules.sh should be bash compatible
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 25 20:04:15 2009 +0200 (2009-09-25)
parents 329063f300c3
children 7097a62c33a1
files linux/stuff/list_modules.sh
line diff
     1.1 --- a/linux/stuff/list_modules.sh	Fri Sep 25 18:21:42 2009 +0200
     1.2 +++ b/linux/stuff/list_modules.sh	Fri Sep 25 20:04:15 2009 +0200
     1.3 @@ -3,6 +3,11 @@
     1.4  # 2008/06/07 <pascal.bellard@slitaz.org> - GNU General Public License.
     1.5  #
     1.6  
     1.7 +find_modules()
     1.8 +{
     1.9 +find $_pkg/lib/modules/*-slitaz/kernel/$1 -type f -exec basename {} \;
    1.10 +}
    1.11 +
    1.12  if [ -z "$1" ] ; then
    1.13    cat 1>&2 <<EOT
    1.14    
    1.15 @@ -23,8 +28,7 @@
    1.16  fi
    1.17  
    1.18  for tree in $@; do
    1.19 -    for module in $(find $_pkg/lib/modules/*-slitaz/kernel/$tree \
    1.20 -                         -type f -exec basename {} \;) ; do
    1.21 +    for module in $(find_modules $tree) ; do
    1.22          grep /$module: $_pkg/lib/modules/*-slitaz/modules.dep ||
    1.23          find $_pkg/lib/modules/*-slitaz/kernel/$tree -name $module
    1.24      done | awk '{ for (i = 1; i <= NF; i++)  print $i; }'