NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/56862: boot.cfg bug with userconf



The following reply was made to PR bin/56862; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: Thomas Klausner <wiz%NetBSD.org@localhost>, Valery Ushakov <uwe%stderr.spb.ru@localhost>
Subject: Re: bin/56862: boot.cfg bug with userconf
Date: Sun, 5 Jun 2022 20:59:01 +0000 (UTC)

 On Sun, 5 Jun 2022, Valery Ushakov wrote:
 
 >   * Use any default command defined in boot.cfg as default args
 >     if the user runs "boot" with no arguments
 >
 >  This is useful in circumstances where you e.g. need to interrupt
 >  the normal boot process to switch to serial console, and where
 >  simply "boot netbsd" is no longer sufficient (e.g. as with install
 >  media which needs the miniroot kernel module loaded).
 >
 
 OK, if you want to boot the default entry, then the simplest thing to
 do here is to have a special arg like "default" for the "boot" command:
 
 ---START---
 diff -urN sys/arch/i386/stand/efiboot.orig/boot.c sys/arch/i386/stand/efiboot/boot.c
 --- sys/arch/i386/stand/efiboot.orig/boot.c	2021-09-07 11:41:31.000000000 +0000
 +++ sys/arch/i386/stand/efiboot/boot.c	2022-06-05 20:50:41.381791596 +0000
 @@ -445,6 +445,9 @@
   	char *filename;
   	int howto;
 
 +	if (arg && !strcmp(arg, "default"))
 +		bootdefault();
 +
   	if (!parseboot(arg, &filename, &howto))
   		return;
 
 @@ -453,8 +456,6 @@
   	} else {
   		int i;
 
 -		if (howto == 0)
 -			bootdefault();
   		for (i = 0; i < NUMNAMES; i++) {
   			bootit(names[i][0], howto);
   			bootit(names[i][1], howto);
 ---END---
 
 Or, should the code be re-written to preserve current syntax?
 
 -RVP
 


Home | Main Index | Thread Index | Old Index