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
|
2002-06-13 22:14:37 +00:00
|
|
|
# KEYWORD: FreeBSD NetBSD
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="root"
|
|
|
|
start_cmd="root_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
root_start()
|
|
|
|
{
|
2002-09-06 16:18:05 +00:00
|
|
|
case ${OSTYPE} in
|
2002-06-13 22:14:37 +00:00
|
|
|
FreeBSD)
|
|
|
|
# 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-10-12 10:31:31 +00:00
|
|
|
if ! mount -u -o rw /; then
|
2002-06-13 22:14:37 +00:00
|
|
|
echo 'Mounting root filesystem rw failed, startup aborted'
|
2003-12-09 08:17:33 +00:00
|
|
|
/bin/kill -QUIT $$
|
2002-06-13 22:14:37 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
umount -a >/dev/null 2>&1
|
|
|
|
|
|
|
|
# If we booted a special kernel remove the record
|
|
|
|
# so we will boot the default kernel next time.
|
2002-10-31 02:06:05 +00:00
|
|
|
if [ -e /boot/nextkernel ]; then
|
|
|
|
rm -f /boot/nextkernel
|
|
|
|
fi
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
NetBSD)
|
|
|
|
umount -a >/dev/null 2>&1
|
|
|
|
mount /
|
|
|
|
rm -f /fastboot
|
|
|
|
;;
|
|
|
|
esac
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|