Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Process /etc/modules.conf (if present) at startup, before se...
details: https://anonhg.NetBSD.org/src/rev/1f17247464dd
branches: trunk
changeset: 336822:1f17247464dd
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Mar 21 19:10:43 2015 +0000
description:
Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
diffstat:
distrib/sets/lists/etc/mi | 3 +-
distrib/sets/lists/man/mi | 5 ++-
etc/defaults/rc.conf | 3 +-
etc/mtree/special | 3 +-
etc/rc.d/Makefile | 6 ++--
etc/rc.d/modules | 30 ++++++++++++++++++++
share/man/man5/Makefile | 6 ++--
share/man/man5/modules.conf.5 | 58 ++++++++++++++++++++++++++++++++++++++++
usr.sbin/postinstall/postinstall | 3 +-
9 files changed, 106 insertions(+), 11 deletions(-)
diffs (239 lines):
diff -r 372056a3b0e3 -r 1f17247464dd distrib/sets/lists/etc/mi
--- a/distrib/sets/lists/etc/mi Sat Mar 21 16:42:17 2015 +0000
+++ b/distrib/sets/lists/etc/mi Sat Mar 21 19:10:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.235 2015/02/21 23:13:00 joerg Exp $
+# $NetBSD: mi,v 1.236 2015/03/21 19:10:43 jmcneill Exp $
#
# Note: end-user configuration files that are moved to another location
# should not be marked "obsolete"; they should just be removed from
@@ -232,6 +232,7 @@
./etc/rc.d/makemandb etc-man-rc
./etc/rc.d/mdnsd etc-mdns-rc
./etc/rc.d/mixerctl etc-audio-rc
+./etc/rc.d/modules etc-sys-rc
./etc/rc.d/mopd etc-bootserver-rc
./etc/rc.d/motd etc-sys-rc
./etc/rc.d/mountall etc-sys-rc
diff -r 372056a3b0e3 -r 1f17247464dd distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sat Mar 21 16:42:17 2015 +0000
+++ b/distrib/sets/lists/man/mi Sat Mar 21 19:10:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1496 2015/03/02 21:55:45 christos Exp $
+# $NetBSD: mi,v 1.1497 2015/03/21 19:10:43 jmcneill Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -2114,6 +2114,7 @@
./usr/share/man/cat5/master.passwd.0 man-sys-catman .cat
./usr/share/man/cat5/memcache_table.0 man-postfix-catman postfix,.cat
./usr/share/man/cat5/mixerctl.conf.0 man-audio-catman .cat
+./usr/share/man/cat5/modules.conf.0 man-sys-catman .cat
./usr/share/man/cat5/moduli.0 man-secsh-catman crypto,.cat
./usr/share/man/cat5/monthly.0 man-sys-catman .cat
./usr/share/man/cat5/monthly.conf.0 man-sys-catman .cat
@@ -5081,6 +5082,7 @@
./usr/share/man/html5/master.passwd.html man-sys-htmlman html
./usr/share/man/html5/memcache_table.html man-postfix-htmlman postfix,html
./usr/share/man/html5/mixerctl.conf.html man-audio-htmlman html
+./usr/share/man/html5/modules.conf.html man-sys-htmlman html
./usr/share/man/html5/moduli.html man-secsh-htmlman crypto,html
./usr/share/man/html5/monthly.conf.html man-sys-htmlman html
./usr/share/man/html5/monthly.html man-sys-htmlman html
@@ -7998,6 +8000,7 @@
./usr/share/man/man5/master.passwd.5 man-sys-man .man
./usr/share/man/man5/memcache_table.5 man-postfix-man postfix,.man
./usr/share/man/man5/mixerctl.conf.5 man-audio-man .man
+./usr/share/man/man5/modules.conf.5 man-sys-man .man
./usr/share/man/man5/moduli.5 man-secsh-man crypto,.man
./usr/share/man/man5/monthly.5 man-sys-man .man
./usr/share/man/man5/monthly.conf.5 man-sys-man .man
diff -r 372056a3b0e3 -r 1f17247464dd etc/defaults/rc.conf
--- a/etc/defaults/rc.conf Sat Mar 21 16:42:17 2015 +0000
+++ b/etc/defaults/rc.conf Sat Mar 21 19:10:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.conf,v 1.131 2015/02/21 23:13:00 joerg Exp $
+# $NetBSD: rc.conf,v 1.132 2015/03/21 19:10:43 jmcneill Exp $
#
# /etc/defaults/rc.conf --
# default configuration of /etc/rc.conf
@@ -132,6 +132,7 @@
sysdb=YES # build system databases
rndctl=NO rndctl_flags="" # configure rndctl(8)
gpio=NO # configure GPIO devices
+modules=YES # process /etc/modules.conf
# cope with other OSes using the real time clock at localtime on this
# machine (by adjusting kern.rtc_offset at boot)
diff -r 372056a3b0e3 -r 1f17247464dd etc/mtree/special
--- a/etc/mtree/special Sat Mar 21 16:42:17 2015 +0000
+++ b/etc/mtree/special Sat Mar 21 19:10:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: special,v 1.151 2015/02/21 23:13:00 joerg Exp $
+# $NetBSD: special,v 1.152 2015/03/21 19:10:43 jmcneill Exp $
# @(#)special 8.2 (Berkeley) 1/23/94
#
# This file may be overwritten on upgrades.
@@ -233,6 +233,7 @@
./etc/rc.d/makemandb type=file mode=0555
./etc/rc.d/mdnsd type=file mode=0555
./etc/rc.d/mixerctl type=file mode=0555
+./etc/rc.d/modules type=file mode=0555
./etc/rc.d/mopd type=file mode=0555
./etc/rc.d/motd type=file mode=0555
./etc/rc.d/mountall type=file mode=0555
diff -r 372056a3b0e3 -r 1f17247464dd etc/rc.d/Makefile
--- a/etc/rc.d/Makefile Sat Mar 21 16:42:17 2015 +0000
+++ b/etc/rc.d/Makefile Sat Mar 21 19:10:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.91 2015/02/21 23:13:00 joerg Exp $
+# $NetBSD: Makefile,v 1.92 2015/03/21 19:10:43 jmcneill Exp $
.include <bsd.own.mk>
@@ -26,8 +26,8 @@
irdaattach iscsi_target iscsid isdnd isibootd \
kdc \
ldconfig ldpd local lpd lvm \
- makemandb mdnsd mixerctl mopd motd mountall mountcritlocal \
- mountcritremote mountd moused mrouted \
+ makemandb mdnsd mixerctl modules mopd motd mountall \
+ mountcritlocal mountcritremote mountd moused mrouted \
named ndbootd network newsyslog nfsd nfslocking npf ntpd \
ntpdate \
perusertmp pf pf_boot pflogd postfix powerd ppp pwcheck \
diff -r 372056a3b0e3 -r 1f17247464dd etc/rc.d/modules
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/rc.d/modules Sat Mar 21 19:10:43 2015 +0000
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $NetBSD: modules,v 1.1 2015/03/21 19:10:43 jmcneill Exp $
+#
+
+# PROVIDE: modules
+# BEFORE: securelevel
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="modules"
+rcvar=$name
+start_cmd="modules_start"
+stop_cmd=":"
+
+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
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -r 372056a3b0e3 -r 1f17247464dd share/man/man5/Makefile
--- a/share/man/man5/Makefile Sat Mar 21 16:42:17 2015 +0000
+++ b/share/man/man5/Makefile Sat Mar 21 19:10:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2013/12/28 17:35:01 christos Exp $
+# $NetBSD: Makefile,v 1.71 2015/03/21 19:10:43 jmcneill Exp $
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# missing: dump.5 plot.5
@@ -9,8 +9,8 @@
fs.5 fstab.5 genassym.cf.5 gpio.conf.5 group.5 hesiod.conf.5 \
hosts.5 hosts.equiv.5 ifaliases.5 ifconfig.if.5 intro.5 \
ipsec.conf.5 ld.so.conf.5 link.5 locale.alias.5 \
- locate.conf.5 login.conf.5 mixerctl.conf.5 mk.conf.5 monthly.5 \
- motd.5 netconfig.5 netgroup.5 networks.5 nologin.5 \
+ locate.conf.5 login.conf.5 mixerctl.conf.5 modules.conf.5 mk.conf.5 \
+ monthly.5 motd.5 netconfig.5 netgroup.5 networks.5 nologin.5 \
nsswitch.conf.5 passwd.5 passwd.conf.5 phones.5 \
printcap.5 protocols.5 ranlib.5 rc.conf.5 remote.5 \
resolv.conf.5 route.conf.5 rpc.5 \
diff -r 372056a3b0e3 -r 1f17247464dd share/man/man5/modules.conf.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man5/modules.conf.5 Sat Mar 21 19:10:43 2015 +0000
@@ -0,0 +1,58 @@
+.\" $NetBSD: modules.conf.5,v 1.1 2015/03/21 19:10:43 jmcneill Exp $
+.\"
+.\" Copyright (c) 2015 Jared McNeill <jmcneill%invisible.ca@localhost>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd March 21, 2015
+.Dt MODULES.CONF 5
+.Os
+.Sh NAME
+.Nm modules.conf
+.Nd Kernel module config file
+.Sh DESCRIPTION
+The
+.Nm
+file is read by the
+.Pa modules
+rc.d script during system start-up to load modules at boot,
+before the system security level is raised.
+.Ss FILE FORMAT
+Lines starting with a hash
+.Pq Sq #
+and empty lines are ignored.
+All other lines are passed to
+.Xr modload 8 .
+.Sh FILES
+.Bl -tag -width XXetcXmodulesXconfXX
+.It Pa /etc/modules.conf
+The
+.Nm
+configuration file resides in
+.Pa /etc .
+.It Pa /etc/rc.d/modules
+.Xr rc.d 8
+script that parses
+.Nm .
+.Sh SEE ALSO
+.Xr modload 8 ,
+.Xr rc 8
diff -r 372056a3b0e3 -r 1f17247464dd usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall Sat Mar 21 16:42:17 2015 +0000
+++ b/usr.sbin/postinstall/postinstall Sat Mar 21 19:10:43 2015 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: postinstall,v 1.189 2015/02/21 23:13:00 joerg Exp $
+# $NetBSD: postinstall,v 1.190 2015/03/21 19:10:43 jmcneill Exp $
#
# Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -1366,6 +1366,7 @@
makemandb
mdnsd
mixerctl
+modules
mopd
motd
mountall
Home |
Main Index |
Thread Index |
Old Index