From cb329c9440956b8d8f5913db562468c678e64b91 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 14 Oct 2004 08:44:34 +0000 Subject: [PATCH] Initialize the 'kernel' environment variable from loader.4th instead of loader.conf. loader.4th will set the kernel name to 'kernel' for normal boots, 'kernel.BOOTP' for PXE boots. This allows us to distinguish between BOOTP kernels and normal kernels and, in particular, this will allow both to be shipped on the CD. --- sys/boot/forth/loader.4th | 7 ++++++- sys/boot/forth/loader.conf | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/boot/forth/loader.4th b/sys/boot/forth/loader.4th index 6b346a40cd..15d722717d 100644 --- a/sys/boot/forth/loader.4th +++ b/sys/boot/forth/loader.4th @@ -23,7 +23,7 @@ \ SUCH DAMAGE. \ \ $FreeBSD: src/sys/boot/forth/loader.4th,v 1.24 2002/05/24 02:28:58 gordon Exp $ -\ $DragonFly: src/sys/boot/forth/loader.4th,v 1.3 2003/11/10 06:08:34 dillon Exp $ +\ $DragonFly: src/sys/boot/forth/loader.4th,v 1.4 2004/10/14 08:44:34 dillon Exp $ s" arch-alpha" environment? [if] [if] s" loader_version" environment? [if] @@ -133,6 +133,11 @@ only forth definitions also support-functions \ read to the end, load kernel and modules. : start ( -- ) ( throws: abort & user-defined ) + s" boot.nfsroot.path" getenv? if + s" kernel.BOOTP" s" kernel" setenv + else + s" kernel" s" kernel" setenv + then s" /boot/defaults/loader.conf" initialize include_conf_files include_nextboot_file diff --git a/sys/boot/forth/loader.conf b/sys/boot/forth/loader.conf index d67836b508..7b3573e522 100644 --- a/sys/boot/forth/loader.conf +++ b/sys/boot/forth/loader.conf @@ -7,7 +7,7 @@ # All arguments must be in double quotes. # # $FreeBSD: src/sys/boot/forth/loader.conf,v 1.72 2003/07/01 01:03:32 brueffer Exp $ -# $DragonFly: src/sys/boot/forth/loader.conf,v 1.5 2004/09/20 11:54:11 asmodai Exp $ +# $DragonFly: src/sys/boot/forth/loader.conf,v 1.6 2004/10/14 08:44:34 dillon Exp $ ############################################################## ### Basic configuration options ############################ @@ -15,7 +15,9 @@ exec=".( Loading /boot/defaults/loader.conf ) cr" -kernel="kernel" # /boot sub-directory containing kernel and modules +# NOTE: the default 'kernel' environment variable is not set +# in the default/loader.conf file any more, it is set based on +# whether we pxebooted or not in loader.4th bootfile="kernel" # Kernel name (possibly absolute path) kernel_options="" -- 2.41.0