Home | History | Annotate | Line # | Download | only in rc.d
      1 #!/bin/sh
      2 #
      3 # $NetBSD: modules,v 1.2 2015/04/06 15:07:50 mlelstv Exp $
      4 #
      5 
      6 # PROVIDE: modules
      7 # REQUIRE: fsck_root
      8 # BEFORE: root
      9 
     10 $_rc_subr_loaded . /etc/rc.subr
     11 
     12 name="modules"
     13 rcvar=$name
     14 start_cmd="modules_start"
     15 stop_cmd=":"
     16 
     17 modules_start()
     18 {
     19 	if [ -f /etc/modules.conf ]; then
     20 		echo "Loading modules."
     21 		while read name args; do
     22 			case $name in
     23 			''|"#"*)
     24 				;;
     25 			*)
     26 				(
     27 					set -o noglob
     28 					eval set -- $args
     29 					modload "$@" "$name"
     30 				)
     31 				;;
     32 			esac
     33 		done < /etc/modules.conf
     34 	fi
     35 }
     36 
     37 load_rc_config $name
     38 run_rc_command "$1"
     39