root revision 225736
1#!/bin/sh
2#
3# $FreeBSD: stable/9/etc/rc.d/root 177062 2008-03-11 17:21:14Z delphij $
4#
5
6# PROVIDE: root
7# REQUIRE: fsck
8# KEYWORD: nojail
9
10. /etc/rc.subr
11
12name="root"
13start_cmd="root_start"
14stop_cmd=":"
15
16root_start()
17{
18	# root normally must be read/write, but if this is a BOOTP NFS
19	# diskless boot it does not have to be.
20	#
21	case ${root_rw_mount} in
22	[Nn][Oo] | '')
23		;;
24	*)
25		if ! mount -uw /; then
26			echo 'Mounting root filesystem rw failed, startup aborted'
27			stop_boot true
28		fi
29		;;
30	esac
31
32	umount -a >/dev/null 2>&1
33
34	# If we booted a special kernel remove the record
35	# so we will boot the default kernel next time.
36	if [ -x /sbin/nextboot ]; then
37		/sbin/nextboot -D > /dev/null 2>&1
38	fi
39}
40
41load_rc_config $name
42run_rc_command "$1"
43