Author: glen
Date: Sun Oct 23 21:26:51 2011
New Revision: 12389

Added:
   rc-scripts/trunk/init/modules.conf
Modified:
   rc-scripts/trunk/init/Makefile.am
   rc-scripts/trunk/rc.d/rc.sysinit
Log:
load /etc/modules in upstart

Modified: rc-scripts/trunk/init/Makefile.am
==============================================================================
--- rc-scripts/trunk/init/Makefile.am   (original)
+++ rc-scripts/trunk/init/Makefile.am   Sun Oct 23 21:26:51 2011
@@ -3,6 +3,7 @@
 initdir = @initdir@
 
 init_DATA = random.conf rc.conf rcS-sulogin.conf rcS.conf udev.conf \
-       allowlogin.conf sys-chroots.conf cpusets.conf cryptsetup.conf local.conf
+       allowlogin.conf sys-chroots.conf cpusets.conf cryptsetup.conf 
local.conf \
+       modules.conf
 
 EXTRA_DIST = $(init_DATA)

Added: rc-scripts/trunk/init/modules.conf
==============================================================================
--- (empty file)
+++ rc-scripts/trunk/init/modules.conf  Sun Oct 23 21:26:51 2011
@@ -0,0 +1,38 @@
+# module-init-tools - load modules from /etc/modules
+#
+# This task loads the kernel modules specified in the /etc/modules file
+
+description "load modules from /etc/modules"
+
+start on (startup
+      and started udev)
+
+task
+
+script
+       {
+               read _x _y v _z
+               old_IFS=$IFS
+               # strip _* or -* from versions like: "2.6.25_vanilla-1", 
"2.6.25-1"
+               IFS='_-'
+               set -- $v
+               v1=${1}
+               IFS='.'
+               set -- $v1
+               IFS=$old_IFS
+
+               kernel="$1.$2"
+               kerneleq="$1.$2.$3"
+       } < /proc/version
+
+       # Loop over every line in modules file
+       ( \
+               grep -hvE '^(#|[[:blank:]]*$)' /etc/modules 
/etc/modules.$kernel /etc/modules.$kerneleq 2>/dev/null
+               echo '' # make sure there is a LF at the end
+       ) | while read module args; do
+               [ -z "$module" ] && continue
+               # strip comments
+               args=${args%%#*}
+               modprobe -s $module -- $args
+       done
+end script

Modified: rc-scripts/trunk/rc.d/rc.sysinit
==============================================================================
--- rc-scripts/trunk/rc.d/rc.sysinit    (original)
+++ rc-scripts/trunk/rc.d/rc.sysinit    Sun Oct 23 21:26:51 2011
@@ -560,7 +560,9 @@
        fi
 
        # Load modules
-       load_kernel_modules
+       if ! use_upstart; then
+               load_kernel_modules
+       fi
 
        if [ -x /sbin/multipath ]; then
                # first make nodes that were discarded due (possible) new /dev 
mount
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to