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-03-08 12:25:05 +00:00
|
|
|
# KEYWORD: FreeBSD 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
|
|
|
*)
|
|
|
|
if ! mount -u -o rw /; then
|
|
|
|
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.
|
|
|
|
if [ -e /boot/nextkernel ]; then
|
|
|
|
rm -f /boot/nextkernel
|
|
|
|
fi
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|