Adding modules cmdline options for genkernel (module.option[=value]).
authorDzianis Kahanovich <mahatma@eu.by>
Wed, 5 Jan 2011 15:31:00 +0000 (15:31 +0000)
committerRichard Yao <ryao@cs.stonybrook.edu>
Thu, 19 Jul 2012 20:03:17 +0000 (16:03 -0400)
Effective for genkernel's modprobe script or busybox "not small"
modprobe.

Signed-off-by: Dzianis Kahanovich <mahatma@eu.by>
Updated-by: Richard Yao <ryao@cs.stonybrook.edu>
defaults/linuxrc
defaults/modprobe

index 0403b4d51b77e3fa9ca12289ec988067c947f49a..91a3396b2e703fb879041465765d949da7cfe9b3 100755 (executable)
@@ -39,6 +39,7 @@ FAKE_ROOT=''
 REAL_ROOTFLAGS=''
 ROOTFSTYPE='auto'
 CRYPT_SILENT=0
+mkdir -p /etc/cmdline /etc/modprobe.d
 for x in ${CMDLINE}
 do
        case "${x}" in
@@ -240,6 +241,23 @@ do
                nounionfs)
                        USE_UNIONFS_NORMAL=0
                        ;;
+               ## for "module.param[=val]" we creating
+               ## /etc/modprobe.d/module.param.conf: "options module param[=val]"
+               ## /etc/cmdline/module.param:"param[=val]"
+               ## first for CONFIG_MODPROBE_SMALL=n, next for script modprobe
+               *=*)
+                       case "${x%%=*}" in
+                       *.*)
+                               y="${x%%[=/]*}"
+                               echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/$y.conf"
+                               echo "${x#*.}" >"/etc/cmdline/$y"
+                       ;;
+                       esac
+               ;;
+               *.*)
+                       echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/${x%%/*}.conf"
+                       echo "${x#*.}" >"/etc/cmdline/${x%%/*}"
+               ;;
        esac
 done
 
index ba2d890f3cf88cdffda8f2f85dbc5ceca81b24fb..1f606bd2b7b49603ecfa3488eeb0e440b5c3bcd4 100755 (executable)
@@ -110,7 +110,10 @@ modprobe2() {
                        filler=1
                fi
        done
-       ${INSMOD} ${real_path} > /dev/null 2>&1
+       # placing options into x
+       x="${real_path##*/}"
+       x="`cat "/etc/cmdline/${x%.ko*}".* 2>/dev/null`"
+       ${INSMOD} ${real_path} ${x} > /dev/null 2>&1
        ret=$?
        if [ ${ret} -eq 0 ]
        then