Subject: Re: Extending config(8) to allow different root fs types
To: Martin Husemann <martin@rumolt.teuto.de>
From: Chris G Demetriou <Chris_G_Demetriou@ux2.sp.cs.cmu.edu>
List: tech-kern
Date: 11/03/1996 00:38:10
> The i386 port has no way to specify boot and swap via PROM, so its root
> and swap configuration is hardcoded into the kernel via config(8). We have
> the famous option "GENERIC", which will cause the kernel to runtime-configure
> its root and swap device.

Actually, that's not really true.  The firmware _us_ supposed to pass
an indicator of the boot device name on to the kernel, and in fact
it's the same indicator that the boot blocks use to load the kernel!

The problem is translating that into something the kernel can actually
use.  It's probably possible, but not being an i386 goo-roo, I
couldn't tell you what it is...


> What I would realy like to have is:
> 
>  (a) a way to specify boot, root and swap devices from firmware
>      (no way on the i386) and let everything happen automatically
> 
>  (b) simply declare something like this:
> 
> 	config netbsd root on cd0 swap on sd0 and sd1 and wd0 and wd1
> 
>      and have config(8) or the kernel figure out the filesystemtype
>      of my rootdevice automagically or via another line like
> 
> 	rootfstype cd9660
> 
> It might be convenient in some situations to have a list of possible
> root-fs types and let the kernel try each in turn. We could have LFS, AFS
> and other types as root.

So, let's just ignore the fact that one _really_ shouldn't have to
specify swap partitions in the config file...  8-)

i'd say that the syntax should be something more like:

	config netbsd root on wd0 fstype ffs

or, leave out that 'fstype ffs', and it does the 'try a bunch of file
system types and do the right thing' thing.

Alternately, something like "root on wd0:ffs" might make sense
instead, and avoids adding a config keyword.


> The current way config works mixes several steps into one, especially when
> declaring "swap on nfs"; which means "you will get your host configuration
> from the net, will get your root fs from the net and swap over network
> as well". I would suggest to split each of these actions (maybe having a
> shortcut for the above common example) and use different keywords to state
> 
> hostconfig	net/local
> rootfs		partition
> swap		net/partition(s)
> rootfstype	fstype(s)

So, the current method is broken in a couple of ways:

	(1) you need to specify swap type in config file at all,

	(2) root on nfs == swap on nfs; broken.

	(3) no way to specify fs type.

Your proposed syntax fixes that (maybe 8-), but adds a big lose: you
can no longer specify multiple kernels from the same config file.

For instance, it should be possible to say:

config netbsd		root on sd0 swap on sd0
config nfsnetbsd	root on nfs swap on nfs
config gennetbsd	swap generic

in the same kernel config file and have three kernels be built.
occasionally that's useful.  I know i've used it a few times, and it
does have a long-standing history.


Unfortunately, the way root is currently mounted is not conducive to
these kinds of changes.  These changes are on my "medium-length list"
and i'm gonig to get to them eventually, but it's not quite trivial.



cgd