root revision 174438
11844Swollman#!/bin/sh
250476Speter#
323549Swosch# $FreeBSD: head/etc/rc.d/root 174438 2007-12-08 07:20:23Z dougb $
423549Swosch#
5139761Skrion
623549Swosch# PROVIDE: root
723549Swosch# REQUIRE: fsck
823549Swosch# KEYWORD: nojail
923549Swosch
1023549Swosch. /etc/rc.subr
1123549Swosch
1223549Swoschname="root"
1323549Swoschstart_cmd="root_start"
1423549Swoschstop_cmd=":"
1595327Sobrien
1623549Swoschroot_start()
1723549Swosch{
1823549Swosch	# root normally must be read/write, but if this is a BOOTP NFS
1923549Swosch	# diskless boot it does not have to be.
2023549Swosch	#
2123549Swosch	case ${root_rw_mount} in
2223549Swosch	[Nn][Oo] | '')
2323549Swosch		;;
2423549Swosch	*)
2523549Swosch		if ! mount -uw /; then
2623549Swosch			echo 'Mounting root filesystem rw failed, startup aborted'
2795509Sru			stop_boot true
2896164Sru		fi
2944922Sbde		;;
3023549Swosch	esac
311638Srgrimes
3294940Sru	umount -a >/dev/null 2>&1
3323549Swosch
3499875Sru	# If we booted a special kernel remove the record
3599875Sru	# so we will boot the default kernel next time.
3699875Sru	if [ -x /sbin/nextboot ]; then
3799875Sru		/sbin/nextboot -D
38133369Sharti	fi
3999875Sru}
4099875Sru
4199875Sruload_rc_config $name
4299875Srurun_rc_command "$1"
4395306Sru