summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/root
diff options
context:
space:
mode:
authorgordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
committergordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
commit9c5433cb225f7a4e56e87623ea2e4011179553a5 (patch)
tree3168589e209abd888b033397e3c46dee6131a116 /etc/rc.d/root
parent50d99cdfecd92f5323a18aa791a5b1cb9d8b7191 (diff)
downloadFreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.zip
FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.tar.gz
Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next. Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson
Diffstat (limited to 'etc/rc.d/root')
-rwxr-xr-xetc/rc.d/root36
1 files changed, 32 insertions, 4 deletions
diff --git a/etc/rc.d/root b/etc/rc.d/root
index 8a7e3b0..d1c0783 100755
--- a/etc/rc.d/root
+++ b/etc/rc.d/root
@@ -1,10 +1,12 @@
#!/bin/sh
#
-# $NetBSD: root,v 1.1.1.1 2000/03/10 11:53:24 lukem Exp $
+# $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $
+# $FreeBSD$
#
# PROVIDE: root
# REQUIRE: fsck
+# KEYWORD: FreeBSD NetBSD
. /etc/rc.subr
@@ -14,9 +16,35 @@ stop_cmd=":"
root_start()
{
- umount -a >/dev/null 2>&1
- mount /
- rm -f /fastboot
+ case `${CMD_OSTYPE}` in
+ 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] | '')
+ ;;
+ *)
+ if ! mount -u -o rw / ; then
+ echo 'Mounting root filesystem rw failed, startup aborted'
+ exit 1
+ fi
+ ;;
+ esac
+
+ umount -a >/dev/null 2>&1
+ mount /
+
+ # If we booted a special kernel remove the record
+ # so we will boot the default kernel next time.
+ [ -e /boot/nextkernel ] && rm -f /boot/nextkernel
+ ;;
+ NetBSD)
+ umount -a >/dev/null 2>&1
+ mount /
+ rm -f /fastboot
+ ;;
+ esac
}
load_rc_config $name
OpenPOWER on IntegriCloud