2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: root
|
|
|
|
# REQUIRE: fsck
|
2004-10-07 13:55:26 +00:00
|
|
|
# KEYWORD: nojail
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="root"
|
|
|
|
start_cmd="root_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
root_start()
|
|
|
|
{
|
2004-01-17 10:59:43 +00:00
|
|
|
# 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] | '')
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
2004-01-17 10:59:43 +00:00
|
|
|
*)
|
2005-12-02 21:33:43 +00:00
|
|
|
if ! mount -uw /; then
|
2004-01-17 10:59:43 +00:00
|
|
|
echo 'Mounting root filesystem rw failed, startup aborted'
|
2007-05-18 12:04:41 +00:00
|
|
|
stop_boot true
|
2004-01-17 10:59:43 +00:00
|
|
|
fi
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
2004-01-17 10:59:43 +00:00
|
|
|
|
|
|
|
umount -a >/dev/null 2>&1
|
|
|
|
|
|
|
|
# If we booted a special kernel remove the record
|
|
|
|
# so we will boot the default kernel next time.
|
2006-02-17 08:34:01 +00:00
|
|
|
if [ -x /sbin/nextboot ]; then
|
|
|
|
/sbin/nextboot -D
|
|
|
|
fi
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|