#!/bin/sh # # $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $ # $FreeBSD: src/etc/rc.d/root,v 1.5 2002/10/31 02:06:05 gordon Exp $ # $DragonFly: src/etc/rc.d/root,v 1.4 2005/11/19 21:47:32 swildner Exp $ # # PROVIDE: root # REQUIRE: fsck . /etc/rc.subr name="root" start_cmd="root_start" stop_cmd=":" root_start() { # 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. if [ -e /boot/nextkernel ]; then rm -f /boot/nextkernel fi } load_rc_config $name run_rc_command "$1"