From: Dzianis Kahanovich Date: Wed, 5 Jan 2011 15:31:00 +0000 (+0000) Subject: Adding modules cmdline options for genkernel (module.option[=value]). X-Git-Tag: v3.4.39~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2bf6b9045db63e8163ac6a83137077eb8b9ecade;p=genkernel.git Adding modules cmdline options for genkernel (module.option[=value]). Effective for genkernel's modprobe script or busybox "not small" modprobe. Signed-off-by: Dzianis Kahanovich Updated-by: Richard Yao --- diff --git a/defaults/linuxrc b/defaults/linuxrc index 0403b4d..91a3396 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -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 diff --git a/defaults/modprobe b/defaults/modprobe index ba2d890..1f606bd 100755 --- a/defaults/modprobe +++ b/defaults/modprobe @@ -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