root revision 154499
1292932Sdim#!/bin/sh
2292932Sdim#
3353358Sdim# $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $
4353358Sdim# $FreeBSD: head/etc/rc.d/root 154499 2006-01-18 04:53:48Z wes $
5353358Sdim#
6292932Sdim
7292932Sdim# PROVIDE: root
8292932Sdim# REQUIRE: fsck
9292932Sdim# KEYWORD: nojail
10292932Sdim
11292932Sdim. /etc/rc.subr
12292932Sdim
13292932Sdimname="root"
14292932Sdimstart_cmd="root_start"
15314564Sdimstop_cmd=":"
16314564Sdim
17314564Sdimroot_start()
18314564Sdim{
19292932Sdim	# root normally must be read/write, but if this is a BOOTP NFS
20292932Sdim	# diskless boot it does not have to be.
21292932Sdim	#
22314564Sdim	case ${root_rw_mount} in
23314564Sdim	[Nn][Oo] | '')
24292932Sdim		;;
25314564Sdim	*)
26314564Sdim		if ! mount -uw /; then
27292932Sdim			echo 'Mounting root filesystem rw failed, startup aborted'
28292932Sdim			/bin/kill -QUIT $$
29314564Sdim		fi
30314564Sdim		;;
31314564Sdim	esac
32292932Sdim
33292932Sdim	umount -a >/dev/null 2>&1
34314564Sdim
35314564Sdim	# If we booted a special kernel remove the record
36314564Sdim	# so we will boot the default kernel next time.
37292932Sdim	/sbin/nextboot -D
38292932Sdim}
39292932Sdim
40314564Sdimload_rc_config $name
41314564Sdimrun_rc_command "$1"
42314564Sdim