xref: /dragonfly/etc/rc.d/root (revision 71126e33)
1#!/bin/sh
2#
3# $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $
4# $FreeBSD: src/etc/rc.d/root,v 1.5 2002/10/31 02:06:05 gordon Exp $
5# $DragonFly: src/etc/rc.d/root,v 1.3 2004/01/27 00:42:45 rob Exp $
6#
7
8# PROVIDE: root
9# REQUIRE: fsck
10# KEYWORD: DragonFly
11
12. /etc/rc.subr
13
14name="root"
15start_cmd="root_start"
16stop_cmd=":"
17
18root_start()
19{
20	# root normally must be read/write, but if this is a BOOTP NFS
21	# diskless boot it does not have to be.
22	#
23	case ${root_rw_mount} in
24	[Nn][Oo] | '')
25		;;
26	*)
27		if ! mount -u -o rw /; then
28			echo 'Mounting root filesystem rw failed, startup aborted'
29			exit 1
30		fi
31		;;
32	esac
33	umount -a >/dev/null 2>&1
34	mount /
35	# If we booted a special kernel remove the record
36	# so we will boot the default kernel next time.
37	if [ -e /boot/nextkernel ]; then
38		rm -f /boot/nextkernel
39	fi
40}
41
42load_rc_config $name
43run_rc_command "$1"
44