2001-06-16 09:16:14 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-14 00:14:37 +02:00
|
|
|
# $FreeBSD$
|
2001-06-16 09:16:14 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: root
|
|
|
|
# REQUIRE: fsck
|
2004-10-07 15:55:26 +02:00
|
|
|
# KEYWORD: nojail
|
2001-06-16 09:16:14 +02:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="root"
|
2016-04-23 18:10:54 +02:00
|
|
|
desc="Mount root filesystem read/write"
|
2001-06-16 09:16:14 +02:00
|
|
|
start_cmd="root_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
root_start()
|
|
|
|
{
|
2004-01-17 11:59:43 +01: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-14 00:14:37 +02:00
|
|
|
;;
|
2004-01-17 11:59:43 +01:00
|
|
|
*)
|
2005-12-02 22:33:43 +01:00
|
|
|
if ! mount -uw /; then
|
2004-01-17 11:59:43 +01:00
|
|
|
echo 'Mounting root filesystem rw failed, startup aborted'
|
2007-05-18 14:04:41 +02:00
|
|
|
stop_boot true
|
2004-01-17 11:59:43 +01:00
|
|
|
fi
|
2002-06-14 00:14:37 +02:00
|
|
|
;;
|
|
|
|
esac
|
2004-01-17 11:59:43 +01: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 09:34:01 +01:00
|
|
|
if [ -x /sbin/nextboot ]; then
|
2008-03-11 18:21:14 +01:00
|
|
|
/sbin/nextboot -D > /dev/null 2>&1
|
2006-02-17 09:34:01 +01:00
|
|
|
fi
|
2001-06-16 09:16:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|