summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/kernel_symlink
blob: ae9d9f19a7ceb8067cf1c863c7d8bd0fe9127d75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: kernel_symlink
# REQUIRE: mountcritremote
# KEYWORD: nojail

. /etc/rc.subr

name="kernel_symlink"
rcvar=`set_rcvar`
start_cmd="kernel_symlink_start"
stop_cmd=":"

kernel_symlink_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"
OpenPOWER on IntegriCloud