Subject: sysctl machdep.booted_kernel fails
To: None <port-sparc@NetBSD.ORG>
From: Martin Husemann <martin@duskware.de>
List: port-sparc
Date: 01/26/2002 17:08:32
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?

Martin