From 2a69de95aa809b265fc47092e294242481ccdf6e Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 30 Aug 2005 18:32:24 +0000 Subject: [PATCH] Add nodetect and doload patch from bug #102643, with some modifications. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@311 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- generic/initrd.scripts | 9 +++++++++ generic/linuxrc | 30 +++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/generic/initrd.scripts b/generic/initrd.scripts index c845bbd..e9594e6 100644 --- a/generic/initrd.scripts +++ b/generic/initrd.scripts @@ -26,6 +26,15 @@ parse_opt() { esac } +modules_load() { + for module in $* + do + echo ${module} >> /etc/modules/extra_load + done + + modules_scan extra_load +} + modules_scan() { local MODS [ -d /etc/modules/${1} ] || touch /etc/modules/${1} diff --git a/generic/linuxrc b/generic/linuxrc index 20ae662..c31a8a5 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -139,12 +139,12 @@ do doevms2) USE_EVMS2_NORMAL=1 ;; - # Start Debug Option + # Debug Options debug) DEBUG='yes' ;; - # Scandelay options + # Scan delay options scandelay\=*) SDELAY=`parse_opt "${x}"` ;; @@ -153,9 +153,16 @@ do ;; # Module no-loads + doload\=*) + MDOLIST=`parse_opt "${x}"` + MDOLIST="`echo ${MDOLIST} | sed -e \"s/,/ /g\"`" + ;; + nodetect) + NODETECT=1 + ;; noload\=*) MLIST=`parse_opt "${x}"` - MLIST="`echo ${MLIST} | sed -e \"s/,/ /\"`" + MLIST="`echo ${MLIST} | sed -e \"s/,/ /g\"`" export MLIST ;; @@ -190,16 +197,21 @@ detect_sbp2_devices cmdline_hwopts # Load modules listed in MY_HWOPTS if /lib/modules exists - if [ -d '/lib/modules' ] then good_msg 'Loading modules' # Load appropriate kernel modules - for modules in $MY_HWOPTS - do - modules_scan $modules - eval DO_`echo $modules | sed 's/-//'`=1 - done + if [ "${NODETECT}" -ne '1' ] + then + for modules in $MY_HWOPTS + do + modules_scan $modules + eval DO_`echo $modules | sed 's/-//'`=1 + done + fi + + # Always eval doload=... + modules_load $MDOLIST else for modules in $MY_HWOPTS do -- 2.26.2