aboutsummaryrefslogblamecommitdiff
path: root/etc/rc.d/root
blob: cc703010832238c2589256c77e9147ec2c1b6a26 (plain) (tree)
1
2
3
4
5
6
7
8
9

         

                                                     



               
                 








                      




                                                                      
                  
          
                                      


                                                                                  

                  




                                                         
                         



                    
#!/bin/sh
#
# $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $
# $FreeBSD$
#

# PROVIDE: root
# REQUIRE: fsck
# KEYWORD: nojail

. /etc/rc.subr

name="root"
start_cmd="root_start"
stop_cmd=":"

root_start()
{
	# root normally must be read/write, but if this is a BOOTP NFS
	# diskless boot it does not have to be.
	#
	case ${root_rw_mount} in
	[Nn][Oo] | '')
		;;
	*)
		if ! mount -uw /; then
			echo 'Mounting root filesystem rw failed, startup aborted'
			/bin/kill -QUIT $$
		fi
		;;
	esac

	umount -a >/dev/null 2>&1

	# If we booted a special kernel remove the record
	# so we will boot the default kernel next time.
	/sbin/nextboot -D
}

load_rc_config $name
run_rc_command "$1"