Author: glen
Date: Wed Mar 21 21:58:39 2012
New Revision: 12508

Modified:
   geninitrd/trunk/geninitrd
Log:
kmod compat when parsing modprobe config options

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd   (original)
+++ geninitrd/trunk/geninitrd   Wed Mar 21 21:58:39 2012
@@ -468,6 +468,15 @@
        echo "$modprobe_conf_cache"
 }
 
+# return options for MODULE
+# @param $1 module name
+modprobe_options() {
+       local module=$1
+       # NOTE: module init tools uses "options", kmod uses "option"
+       local options=$(modprobe_conf | awk -vmodule="$module" '{ if ($1 ~ 
"option" && $2 == module) { for(i=3;i<=NF;i++) printf("%s ",$i); }}')
+       echo ${options# }
+}
+
 #
 # defaults to modprobe -c if not told otherwise, this means include statements
 # work from there.
@@ -681,7 +690,7 @@
 
                # name of the module
                local module=${modpath##*/}; module=${module%$modext}
-               local options=$(modprobe_conf | awk -vmodule="$module" '{ if 
($1 == "options" && $2 == module) { for(i=3;i<=NF;i++) printf("%s ",$i); }}' | 
xargs)
+               local options=$(modprobe_options "$module")
                local genericname=$(echo $module | tr - _)
                local usleep=$(eval echo \$MODULE_${genericname}_USLEEP)
                local firmware=$(eval echo \$MODULE_${genericname}_FIRMWARE)
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to