xref: /dragonfly/etc/rc.d/fixbootfile (revision 7485684f)
1#!/bin/sh
2#
3# Fixup kern.bootfile.  In a BOOT+ROOT setup the boot loader does not
4# understand that the boot partition will be mounted as /boot under root
5# in the actual system and sets up the kern.bootfile sysctl incorrectly.
6# This fixes up kern.bootfile.
7#
8
9# PROVIDE: fixbootfile
10# REQUIRE: FILESYSTEMS
11# BEFORE:  sysctl
12
13. /etc/rc.subr
14
15name="fixbootfile"
16start_cmd="fixbootfile_start"
17stop_cmd=":"
18
19fixbootfile_start()
20{
21	case ${fixbootfile} in
22	[Nn][Oo])
23		;;
24	*)
25		bootfile=`${SYSCTL_N} kern.bootfile`
26		if [ -f "/boot$bootfile" ]; then
27			${SYSCTL_W} kern.bootfile="/boot$bootfile"
28		fi
29		;;
30	esac
31}
32
33load_rc_config $name
34run_rc_command "$1"
35