mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-20 23:54:38 +01:00
27bc1b287e
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
52 lines
865 B
Bash
Executable File
52 lines
865 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: root
|
|
# REQUIRE: fsck
|
|
# KEYWORD: FreeBSD NetBSD
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="root"
|
|
start_cmd="root_start"
|
|
stop_cmd=":"
|
|
|
|
root_start()
|
|
{
|
|
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
|
|
run_rc_command "$1"
|