Re: diskless

Miod Vallat <[email protected]> Fri, 19 Feb 2010 15:38:10 +0000
Newsgroups gmane.os.openbsd.mac68k
Message-ID <[email protected]>
> I know that mac68k is mostly abandonware here and that's why I
> deleted the au/x parition on my quadra.
> 
> But I was curious about running diskless.
> 
> It works. Kind of.
> 
> A kernel with "config bsd root on nfs" crash into ddb with an MMU
> fault. But if I tell the booter to ask for root and write my network
> interface name at the prompt, it boots diskless properly.

Sounds like a NULL pointer dereference in setroot().

Does the following diff help? You should get greeted by a panic instead,
as there is no way for the kernel to guess which network interface to
use as its diskless interface, since it has not been booted from it.

If your machine only has one network interface it could be possible to
default to it, though.

Miod

Index: subr_disk.c
===================================================================
RCS file: /cvs/src/sys/kern/subr_disk.c,v
retrieving revision 1.99
diff -u -p -r1.99 subr_disk.c
--- subr_disk.c	14 Jan 2010 23:12:11 -0000	1.99
+++ subr_disk.c	19 Feb 2010 15:36:18 -0000
@@ -1193,7 +1193,7 @@ gotswap:
 	if (ifp)
 		if_addgroup(ifp, "netboot");
 
-	switch (rootdv->dv_class) {
+	switch (rootdv ? rootdv->dv_class : DV_DULL) {
 #if defined(NFSCLIENT)
 	case DV_IFNET:
 		mountroot = nfs_mountroot;