]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - etc/rc.d/root
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / etc / rc.d / root
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: root
7 # REQUIRE: fsck
8 # KEYWORD: nojail
9
10 . /etc/rc.subr
11
12 name="root"
13 start_cmd="root_start"
14 stop_cmd=":"
15
16 root_start()
17 {
18         # root normally must be read/write, but if this is a BOOTP NFS
19         # diskless boot it does not have to be.
20         #
21         case ${root_rw_mount} in
22         [Nn][Oo] | '')
23                 ;;
24         *)
25                 if ! mount -uw /; then
26                         echo 'Mounting root filesystem rw failed, startup aborted'
27                         stop_boot true
28                 fi
29                 ;;
30         esac
31
32         umount -a >/dev/null 2>&1
33
34         # If we booted a special kernel remove the record
35         # so we will boot the default kernel next time.
36         if [ -x /sbin/nextboot ]; then
37                 /sbin/nextboot -D > /dev/null 2>&1
38         fi
39 }
40
41 load_rc_config $name
42 run_rc_command "$1"