head	1.2;
access;
symbols
	netbsd-11-0-RC4:1.2
	netbsd-11-0-RC3:1.2
	netbsd-11-0-RC2:1.2
	netbsd-11-0-RC1:1.2
	perseant-exfatfs-base-20250801:1.2
	netbsd-11:1.2.0.30
	netbsd-11-base:1.2
	netbsd-10-1-RELEASE:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.28
	perseant-exfatfs-base:1.2
	netbsd-8-3-RELEASE:1.2
	netbsd-9-4-RELEASE:1.2
	netbsd-10-0-RELEASE:1.2
	netbsd-10-0-RC6:1.2
	netbsd-10-0-RC5:1.2
	netbsd-10-0-RC4:1.2
	netbsd-10-0-RC3:1.2
	netbsd-10-0-RC2:1.2
	netbsd-10-0-RC1:1.2
	netbsd-10:1.2.0.26
	netbsd-10-base:1.2
	netbsd-9-3-RELEASE:1.2
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.24
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	netbsd-9-2-RELEASE:1.2
	cjep_staticlib_x:1.2.0.22
	cjep_staticlib_x-base:1.2
	netbsd-9-1-RELEASE:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	is-mlppp:1.2.0.20
	is-mlppp-base:1.2
	phil-wifi-20200406:1.2
	netbsd-8-2-RELEASE:1.2
	netbsd-9-0-RELEASE:1.2
	netbsd-9-0-RC2:1.2
	netbsd-9-0-RC1:1.2
	phil-wifi-20191119:1.2
	netbsd-9:1.2.0.18
	netbsd-9-base:1.2
	phil-wifi-20190609:1.2
	netbsd-8-1-RELEASE:1.2
	netbsd-8-1-RC1:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	netbsd-7-2-RELEASE:1.1.2.3
	pgoyette-compat-0728:1.2
	netbsd-8-0-RELEASE:1.2
	phil-wifi:1.2.0.16
	phil-wifi-base:1.2
	pgoyette-compat-0625:1.2
	netbsd-8-0-RC2:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	netbsd-8-0-RC1:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	netbsd-7-1-2-RELEASE:1.1.2.3
	pgoyette-compat:1.2.0.14
	pgoyette-compat-base:1.2
	netbsd-7-1-1-RELEASE:1.1.2.3
	matt-nb8-mediatek:1.2.0.12
	matt-nb8-mediatek-base:1.2
	perseant-stdc-iso10646:1.2.0.10
	perseant-stdc-iso10646-base:1.2
	netbsd-8:1.2.0.8
	netbsd-8-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.6
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	netbsd-7-1:1.1.2.3.0.6
	netbsd-7-1-RELEASE:1.1.2.3
	netbsd-7-1-RC2:1.1.2.3
	netbsd-7-nhusb-base-20170116:1.1.2.3
	bouyer-socketcan:1.2.0.4
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	netbsd-7-1-RC1:1.1.2.3
	pgoyette-localcount-20161104:1.2
	netbsd-7-0-2-RELEASE:1.1.2.3
	localcount-20160914:1.2
	netbsd-7-nhusb:1.1.2.3.0.4
	netbsd-7-nhusb-base:1.1.2.3
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.2
	pgoyette-localcount-base:1.2
	netbsd-7-0-1-RELEASE:1.1.2.3
	netbsd-7-0:1.1.2.3.0.2
	netbsd-7-0-RELEASE:1.1.2.3
	netbsd-7-0-RC3:1.1.2.3
	netbsd-7-0-RC2:1.1.2.3
	netbsd-7-0-RC1:1.1.2.3
	netbsd-7:1.1.0.2;
locks; strict;
comment	@# @;


1.2
date	2015.04.06.15.07.50;	author mlelstv;	state Exp;
branches;
next	1.1;
commitid	nvEDp3HIZjo5Exgy;

1.1
date	2015.03.21.19.10.43;	author jmcneill;	state Exp;
branches
	1.1.2.1;
next	;
commitid	om8vf9H631ZYvvey;

1.1.2.1
date	2015.03.21.19.10.43;	author martin;	state dead;
branches;
next	1.1.2.2;
commitid	2x9OfOgpRs9QB6fy;

1.1.2.2
date	2015.03.26.10.54.35;	author martin;	state Exp;
branches;
next	1.1.2.3;
commitid	2x9OfOgpRs9QB6fy;

1.1.2.3
date	2015.05.16.04.37.04;	author snj;	state Exp;
branches;
next	;
commitid	A0uqQSqqRdKCSCly;


desc
@@


1.2
log
@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.
@
text
@#!/bin/sh
#
# $NetBSD: $
#

# PROVIDE: modules
# REQUIRE: fsck_root
# BEFORE: root

$_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."
		while read name args; do
			case $name in
			''|"#"*)
				;;
			*)
				(
					set -o noglob
					eval set -- $args
					modload "$@@" "$name"
				)
				;;
			esac
		done < /etc/modules.conf
	fi
}

load_rc_config $name
run_rc_command "$1"
@


1.1
log
@Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
@
text
@d3 1
a3 1
# $NetBSD$
d7 2
a8 1
# BEFORE:  securelevel
d21 13
a33 6
		cat /etc/modules.conf |
		while read -r args; do
			args=${args%%#*}		# strip comments
			test -z "$args" && continue
			/sbin/modload $args
		done
@


1.1.2.1
log
@file modules was added on branch netbsd-7 on 2015-03-26 10:54:35 +0000
@
text
@d1 30
@


1.1.2.2
log
@Pull up following revision(s) (requested by jmcneill in ticket #635):
	etc/rc.d/Makefile: revision 1.92
	distrib/sets/lists/man/mi: revision 1.1497
	share/man/man5/Makefile: revision 1.71
	etc/defaults/rc.conf: revision 1.132
	etc/rc.d/modules: revision 1.1
	usr.sbin/postinstall/postinstall: revision 1.190
	distrib/sets/lists/etc/mi: revision 1.236
	etc/mtree/special: revision 1.152
	share/man/man5/modules.conf.5: revision 1.1
Process /etc/modules.conf (if present) at startup, before securelevel is
raised, to allow module loading on ports without a module aware bootloader.
@
text
@a0 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"
@


1.1.2.3
log
@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.
@
text
@d3 1
a3 1
# $NetBSD: modules,v 1.1.2.2 2015/03/26 10:54:35 martin Exp $
d7 1
a7 2
# REQUIRE: fsck_root
# BEFORE: root
d20 6
a25 13
		while read name args; do
			case $name in
			''|"#"*)
				;;
			*)
				(
					set -o noglob
					eval set -- $args
					modload "$@@" "$name"
				)
				;;
			esac
		done < /etc/modules.conf
@


