From 08aff6ef44ac5dc438d916b53aa61385f6d299f3 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 25 Mar 2008 08:31:48 +0000 Subject: Allow per kernel version module arguments. --- conf.d.Linux/modules | 7 +++++-- init.d.Linux/modules.in | 13 +++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/conf.d.Linux/modules b/conf.d.Linux/modules index 7f923e7..2fc26cf 100644 --- a/conf.d.Linux/modules +++ b/conf.d.Linux/modules @@ -5,8 +5,11 @@ #modules_2_6="tun" #modules="ohci1394" -# Give the modules some arguments if needed. -# module_ieee1394_args="debug" +# Give the modules some arguments if needed, per version if necessary. +#module_ieee1394_args="debug" +#module_ieee1394_args_2_6_23_gentoo_r5="ieee1394 ohci1394" +#module_ieee1394_args_2_6_23="tun ieee1394" +#module_ieee1394_args_2_6="tun" # You should consult your kernel documentation and configuration # for a list of modules and their options. diff --git a/init.d.Linux/modules.in b/init.d.Linux/modules.in index b09620d..1a0c745 100644 --- a/init.d.Linux/modules.in +++ b/init.d.Linux/modules.in @@ -23,7 +23,7 @@ start() x=${KV#*.*.} local KV_MICRO=${x%%-*} - local list= x= args= cnt=0 + local list= x= xx= y= args= cnt=0 for x in "${KV}" \ ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} \ ${KV_MAJOR}.${KV_MINOR} \ @@ -35,7 +35,16 @@ start() for x in ${list}; do ebegin "Loading module ${x}" - eval args=\$module_$(shell_var "${x}")_args + xx=$(shell_var "${x}") + for y in "${KV}" \ + ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} \ + ${KV_MAJOR}.${KV_MINOR} \ + ; do + eval args=\$module_${xx}_args_$(shell_var "${y}") + [ -n "${args}" ] && break + done + done + [ -z "${args}" ] && eval args=\$module_${xx}_args eval modprobe -q "${x}" "${args}" eend $? "Failed to load ${x}" && cnt=$((${cnt} + 1)) done -- cgit v1.2.3