Subject: Re: Kernel config file caveat
To: Geoff Adams <gadams@avernus.com>
From: Theo de Raadt <deraadt@theos.com>
List: port-sun3
Date: 04/20/1995 01:47:58
> The sun3 autoconf.c is dependent on GENERIC in a way which seems to
> cause trouble.  Specifically, if GENERIC is not defined, and the
> kernel config file specifies generic swapping, then the root, swap,
> and dump devices are never selected.  Here's the relevent function:

Yup. That's why I wrote it completely differently for the sparc. The
code to handle this is always in the kernel. It determines which of a
number of situations have happened:
	1) "boot -a"
		user wants to set the boot devices. lets you specify
		network device or disk partitions for root/swap,
		supplying nice defaults
	2) bootrom tells us where to boot from, handling
		a) root nfs swap nfs
		b) swap generic
		c) root and swap on disks
	3) bootrom has no idea where to boot from, and uses the default
		a) root nfs swap nfs
		b) root and swap on disks

It is almost always preferable to use "swap generic" and let the rom
tell us what to use.

The code to handle all the above is always in the kernel, so no matter
what case you can always "boot -a" and the kernel will prompt for which
device to use.

Definately look at the sparc code. It works for all the cases, even
for diskless. The two remaining problems are:

(1) swap and root must both be on disks, or both be on one network interface.
 the problem is mountroot is massively overloaded; there should be 3
functions: searchrootandswap(), mountroot() and mountswap().

(2) The standard problem where the swdevt[] array should be dynamic,
so that you can add any and all swap device at any time As well, I
also don't like how "nfs" is overloaded into NODEV in that table,
thereby confusing "pstat -s"...