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