mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-23 11:18:54 +00:00
55fd436b5f
surprising results. For now, at least make it safe to boot the default kernel when /boot/kernel is already a symlink.
28 lines
407 B
Bash
28 lines
407 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: kernel
|
|
# REQUIRE: mountcritremote
|
|
# KEYWORD: nojail
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="kernel"
|
|
start_cmd="kernel_start"
|
|
stop_cmd=":"
|
|
|
|
kernel_start()
|
|
{
|
|
bootdir=$(dirname $(sysctl -n kern.bootfile))
|
|
if [ "$bootdir" != /boot/kernel ] ; then
|
|
if [ ! -e /boot/kernel -o -h /boot/kernel ] ; then
|
|
ln -hfs ${bootdir} /boot/kernel
|
|
fi
|
|
fi
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|