This script symlinks /boot/kernel to the directory that contains the kernel

you booted from, unless /boot/kernel already exists and is not a symlink.
This should only affect people like me who juggle multiple kernels and
have KODIR = /boot/${KERN_IDENT} in /etc/make.conf to keep them apart.
This commit is contained in:
Dag-Erling Smørgrav 2006-03-17 16:28:12 +00:00
parent 4d4b555efa
commit 6f3274197b
2 changed files with 26 additions and 1 deletions

View File

@ -18,7 +18,7 @@ FILES= DAEMON LOGIN NETWORKING SERVERS \
ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \
ipnat ipsec ipxrouted isdnd \
jail \
kadmind kerberos keyserv kldxref kpasswdd \
kadmind kerberos kernel keyserv kldxref kpasswdd \
ldconfig local localpkg lpd \
mixer motd mountcritlocal mountcritremote \
mountd moused mroute6d mrouted msgs \

25
etc/rc.d/kernel Normal file
View File

@ -0,0 +1,25 @@
#!/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 [ ! -e /boot/kernel -o -h /boot/kernel ] ; then
ln -hfs ${bootdir} /boot/kernel
fi
}
load_rc_config $name
run_rc_command "$1"