Subject: Re: sysctl machdep.booted_kernel fails
To: Martin Husemann <martin@duskware.de>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: port-sparc
Date: 01/28/2002 01:35:05
In some email I received from Martin Husemann, sie wrote:
> On all my sparcs, when I do not boot a special kernel, I get this:
> 
> sysctl machdep.booted_kernel
> machdep.booted_kernel: sysctl() failed with No such file or directory
> 
> When I boot an alternative kernel, it works (i.e. answers "netbsd.org").
> 
> I bet this is because I have not set any file or args to boot (just something
> like "boot disk3") - which might be uncommon for people with more sparc
> background or who read the install instructions ;-)
> 
> Anyway, since booting works (and our bootloader defaults to loading "netbsd"
> if no filename is specified), the sysctl should do the same.
> 
> in sys/arch/sparc/sparc/promlib.c:opf_getbootfile, should this
> 
>         if (PROM_getprop(node, "bootargs", 1, &blen, (void **)&buf) != 0)
>                 return ("");
> 
> be changed to 
> 
>         if (PROM_getprop(node, "bootargs", 1, &blen, (void **)&buf) != 0 
> 	   || buf[0] == 0)
>                 return ("netbsd");
> 
> ?
> 
> Is there a better way to fix this?

This is tied into something I raised elsewhere - the loader should pass the
kernel name it uses, to the kernel and use that rather than PROM properties
for machdep.booted_kernel.

Darren