mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
127d91856d
we can remove the file as early as possible, but shut up nextboot at this moment if the operation is failed, because /boot is not necessarily a part of /; the newly added second run is placed in rc.d/mountlate after all filesystems were mounted. Discussed at: -rc@ Suggestions from: brooks, mtm MFC after: 1 month
43 lines
684 B
Bash
Executable File
43 lines
684 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: root
|
|
# REQUIRE: fsck
|
|
# KEYWORD: nojail
|
|
|
|
. /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 -uw /; then
|
|
echo 'Mounting root filesystem rw failed, startup aborted'
|
|
stop_boot true
|
|
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.
|
|
if [ -x /sbin/nextboot ]; then
|
|
/sbin/nextboot -D > /dev/null 2>&1
|
|
fi
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|