]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/root
UPDATING: Add note about efifb support and serial output
[FreeBSD/FreeBSD.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 desc="Mount root filesystem read/write"
14 start_cmd="root_start"
15 stop_cmd=":"
16
17 root_start()
18 {
19         # root normally must be read/write, but if this is a BOOTP NFS
20         # diskless boot it does not have to be.
21         #
22         case ${root_rw_mount} in
23         [Nn][Oo] | '')
24                 ;;
25         *)
26                 if ! mount -uw /; then
27                         echo 'Mounting root filesystem rw failed, startup aborted'
28                         stop_boot true
29                 fi
30                 ;;
31         esac
32
33         umount -a >/dev/null 2>&1
34
35         # If we booted a special kernel remove the record
36         # so we will boot the default kernel next time.
37         if [ -x /sbin/nextboot ]; then
38                 /sbin/nextboot -D > /dev/null 2>&1
39         fi
40 }
41
42 load_rc_config $name
43 run_rc_command "$1"