head	1.4;
access;
symbols
	RELENG_7_4_0_RELEASE:1.2.2.1
	RELENG_7_4:1.2.2.1.0.8
	RELENG_7_4_BP:1.2.2.1
	RELENG_7_3_0_RELEASE:1.2.2.1
	RELENG_7_3:1.2.2.1.0.6
	RELENG_7_3_BP:1.2.2.1
	RELENG_7_2_0_RELEASE:1.2.2.1
	RELENG_7_2:1.2.2.1.0.4
	RELENG_7_2_BP:1.2.2.1
	RELENG_7_1_0_RELEASE:1.2.2.1
	RELENG_7_1:1.2.2.1.0.2
	RELENG_7_1_BP:1.2.2.1
	RELENG_7_0_0_RELEASE:1.2
	RELENG_7_0:1.2.0.4
	RELENG_7_0_BP:1.2
	RELENG_7:1.2.0.2
	RELENG_7_BP:1.2;
locks; strict;
comment	@# @;


1.4
date	2008.08.19.14.23.31;	author obrien;	state dead;
branches;
next	1.3;

1.3
date	2008.08.09.01.19.00;	author obrien;	state Exp;
branches;
next	1.2;

1.2
date	2006.07.30.12.54.37;	author mckay;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2006.03.17.16.28.12;	author des;	state Exp;
branches;
next	;

1.2.2.1
date	2008.08.25.16.37.58;	author des;	state dead;
branches;
next	;


desc
@@


1.4
log
@SVN rev 181872 on 2008-08-19 14:23:31Z by obrien

Rename the RCng 'kernel' script to 'kernel_symlink'.

Requested by: many
@
text
@#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/kernel,v 1.3 2008/08/09 01:19:00 obrien Exp $
#

# PROVIDE: kernel
# REQUIRE: mountcritremote
# KEYWORD: nojail

. /etc/rc.subr

name="kernel"
rcvar=`set_rcvar`
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"
@


1.3
log
@SVN rev 181445 on 2008-08-09 01:19:00Z by obrien

Only symlink booted kernel directory to /boot/kernel if user has explicitly
requested it.  This is too dangerous to just do behind the admin's back.
@
text
@d3 1
a3 1
# $FreeBSD$
@


1.2
log
@This script should probably have an enabling variable since it can produce
surprising results.  For now, at least make it safe to boot the default
kernel when /boot/kernel is already a symlink.
@
text
@d13 1
@


1.2.2.1
log
@SVN rev 182165 on 2008-08-25 16:37:58Z by des

MFH: make obrien happy
@
text
@d3 1
a3 1
# $FreeBSD: src/etc/rc.d/kernel,v 1.2 2006/07/30 12:54:37 mckay Exp $
@


1.1
log
@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.
@
text
@d19 4
a22 2
	if [ ! -e /boot/kernel -o -h /boot/kernel ] ; then
		ln -hfs ${bootdir} /boot/kernel
@

