git: 0111f09ca670 - main - kboot: Initialize hostfs_root sooner (and remove kboot.conf)

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 20 May 2024 04:08:35 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=0111f09ca67070271e43655db2e4989cf2d64f88

commit 0111f09ca67070271e43655db2e4989cf2d64f88
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-05-19 17:05:48 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-20 04:05:41 +0000

    kboot: Initialize hostfs_root sooner (and remove kboot.conf)
    
    Move the initialization of hostfs_root to be a bit sooner. While it
    doesn't matter for the default case, we may want to use hostfs files
    sooner.
    
    Also, while we're here, remove kboot.conf. It duplicates the command
    line and has proven difficult to use. It will be replaced by an early
    script that can influence the state of the boot loader before we select
    a device to boot from (including strongly suggesting which one to boot
    from).
    
    Sponsored by:           Netflix
---
 stand/kboot/kboot/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/stand/kboot/kboot/main.c b/stand/kboot/kboot/main.c
index ed5cad450000..994df1ec9fa1 100644
--- a/stand/kboot/kboot/main.c
+++ b/stand/kboot/kboot/main.c
@@ -357,17 +357,17 @@ main(int argc, const char **argv)
 	/* Parse the command line args -- ignoring for now the console selection */
 	parse_args(argc, argv);
 
-	parse_file("host:/kboot.conf");
+	hostfs_root = getenv("hostfs_root");
+	if (hostfs_root == NULL)
+		hostfs_root = "/";
 
 	/* Initialize all the devices */
 	devinit();
 
+	/* Figure out where we're booting from */
 	bootdev = getenv("bootdev");
 	if (bootdev == NULL)
 		bootdev = hostdisk_gen_probe();
-	hostfs_root = getenv("hostfs_root");
-	if (hostfs_root == NULL)
-		hostfs_root = "/";
 #if defined(LOADER_ZFS_SUPPORT)
 	if (bootdev == NULL || strcmp(bootdev, "zfs:") == 0) {
 		/*