]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
filter_kernel_modules is a specialized filter_kernel_modules_by_path
authorJohn Reiser <jreiser@BitWagon.com>
Sat, 27 Aug 2011 21:43:49 +0000 (14:43 -0700)
committerHarald Hoyer <harald@redhat.com>
Thu, 1 Sep 2011 08:03:54 +0000 (10:03 +0200)
dracut-functions

index f41fc7d3ae36c6ff1bfd76090e3a39b0996f1dd7..a72aa538de35f2d6612a15305490b9c137839b1a 100755 (executable)
@@ -863,34 +863,9 @@ filter_kernel_modules_by_path () (
     done
 )
 
-# filter kernel modules to install certain modules that meet specific
-# requirements.
-# $1 = function to call with module name to filter.
-#      This function will be passed the full path to the module to test.
-# The behaviour of this function can vary depending on whether $hostonly is set.
-# If it is, we will only look at modules that are already in memory.
-# If it is not, we will look at all kernel modules
-# This function returns the full filenames of modules that match $1
-filter_kernel_modules () (
-    local _modname _filtercmd
-    if ! [[ $hostonly ]]; then
-        _filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra"'
-        _filtercmd+=' "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz"'
-        _filtercmd+=' 2>/dev/null'
-    else
-        _filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename '
-        _filtercmd+='-k $kernel 2>/dev/null'
-    fi
-    for _modname in $(eval $_filtercmd); do
-        case $_modname in
-            *.ko) "$1" "$_modname" && echo "$_modname";;
-            *.ko.gz) gzip -dc "$_modname" > $initdir/$$.ko
-                $1 $initdir/$$.ko && echo "$_modname"
-                rm -f $initdir/$$.ko
-                ;;
-        esac
-    done
-)
+filter_kernel_modules () {
+    filter_kernel_modules_by_path  drivers  "$1"
+}
 
 # install kernel modules along with all their dependencies.
 instmods() {