2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $
|
|
|
|
# $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'
|
|
|
|
/bin/kill -QUIT $$
|
|
|
|
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-01-18 04:53:48 +00:00
|
|
|
/sbin/nextboot -D
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|