Module Name:    src
Committed By:   snj
Date:           Sat May 16 04:37:04 UTC 2015

Modified Files:
        src/etc/rc.d [netbsd-7]: modules

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #779):
        etc/rc.d/modules: revision 1.2
Parse config file like ifconfig.if(5).
First word is always the module name, followed by options.
Load modules right after root filesystem is checked and before it
becomes writable.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/etc/rc.d/modules

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/modules
diff -u src/etc/rc.d/modules:1.1.2.2 src/etc/rc.d/modules:1.1.2.3
--- src/etc/rc.d/modules:1.1.2.2	Thu Mar 26 10:54:35 2015
+++ src/etc/rc.d/modules	Sat May 16 04:37:04 2015
@@ -1,10 +1,11 @@
 #!/bin/sh
 #
-# $NetBSD: modules,v 1.1.2.2 2015/03/26 10:54:35 martin Exp $
+# $NetBSD: modules,v 1.1.2.3 2015/05/16 04:37:04 snj Exp $
 #
 
 # PROVIDE: modules
-# BEFORE:  securelevel
+# REQUIRE: fsck_root
+# BEFORE: root
 
 $_rc_subr_loaded . /etc/rc.subr
 
@@ -17,12 +18,19 @@ modules_start()
 {
 	if [ -f /etc/modules.conf ]; then
 		echo "Loading modules."
-		cat /etc/modules.conf |
-		while read -r args; do
-			args=${args%%#*}		# strip comments
-			test -z "$args" && continue
-			/sbin/modload $args
-		done
+		while read name args; do
+			case $name in
+			''|"#"*)
+				;;
+			*)
+				(
+					set -o noglob
+					eval set -- $args
+					modload "$@" "$name"
+				)
+				;;
+			esac
+		done < /etc/modules.conf
 	fi
 }
 

Reply via email to