NetBSD/etc/rc.d/modules
mlelstv b68ba22239 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.
2015-04-06 15:07:50 +00:00

39 lines
548 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: modules,v 1.2 2015/04/06 15:07:50 mlelstv Exp $
#
# 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"