Subject: Re: almost diskless booting [Was: 4/200]
To: None <port-sparc@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: port-sparc
Date: 05/12/1995 13:00:14
> I have a SS1+ that I would like to boot from our server (running
> SunOS).  The thing is I would like the root partition on the server,
> but I want to swap to my local disk.  So I have a kernel with:

> config          netbsd  root on  nfs swap on sd0 and sd1 and sd2 and sd3

> and on the server a have (as Chuck Cranor pointed out is needed) in
> /etc/bootparams:

> absolut  root=super:/export/root/absolut\
>          swap=super:/export/swap/absolut

> And when it comes up it actually seems to swap on sd0b (reported by
> pstat -s) as I wanted.

Not surprising.

> But!  can I get away without having the swap=... line above?

Not without significant code changes in the kernel.  The problem is
that initial swap location is too tightly tied to root location; the
mountroot() functions also set up swap.

> I tried swap=/dev/sd0b but that didn't work.

It won't; the bootparam protocol is not designed for the things after
the equal signs to be arbitrary strings.

> Any ideas?

If you want to fix it right, go hack on nfs_mountroot() and/or
nfs_boot_init(), send-pr the fixes, and I'm sure core will love you for
it - there are comments in the code indicating this is something that
should be done but just hasn't been (at least for the SPARC - in
arch/sparc/sparc/autoconf.c, I see a comment saying "XXX Actually, swap
and root must be on the same type of device, (ie. DV_DISK or DV_IFNET)
because of how (*mountroot) is written.  That should be fixed.";
fortunately reality isn't quite as bleak as the comment makes it sound).

Actually, on reading the code, I think that given your kernel config,
it isn't actually doing anything with the server's swap file, though
nfs_boot_init() is written so as to demand that it be set up.  Do you
get a "swap on device 0xxxx" line just after "root on
super:/export/root/absolut"?  If so, your swap is going where you want.

If you just want it to work, make /export/swap/absolut a zero-size file
and you will, I think, be okay - caveat: I have not tried this.

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu