Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/etc/rc.d Pull up following revision(s) (requested by mlel...



details:   https://anonhg.NetBSD.org/src/rev/157dce828eeb
branches:  netbsd-7
changeset: 799336:157dce828eeb
user:      snj <snj%NetBSD.org@localhost>
date:      Sat May 16 04:37:04 2015 +0000

description:
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.

diffstat:

 etc/rc.d/modules |  24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diffs (43 lines):

diff -r 9e658edf3cdb -r 157dce828eeb etc/rc.d/modules
--- a/etc/rc.d/modules  Sat May 16 04:06:04 2015 +0000
+++ b/etc/rc.d/modules  Sat May 16 04:37:04 2015 +0000
@@ -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 @@
 {
        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
 }
 



Home | Main Index | Thread Index | Old Index