Subject: Re: config(8) vs Brett Lymn :-)
To: None <,>
From: Chris Torek <torek@BSDI.COM>
List: tech-kern
Date: 03/06/1997 10:35:27
This has probably been mentioned already, but just in case...

I am not exactly sure why you want to find various locator values.
There are two different sets you could pluck from a running kernel:

	- the set the kernel used to boot from
	- the set at which the kernel found actual devices

These are different in one obvious way, and in one semi-obvious

	A. The first set includes devices that were not found.

This is pretty obvious and could be used to configure a new kernel
for the same machine, omitting unwanted device drivers.  On the other
hand, if you are going for loadable drivers, and you load the driver
to probe (if necessary) and then unload it if not found (or never
load it if not needed to probe), this whole idea becomes uninteresting.

	B. The first set has wildcards; the second does not.

This includes both things like `sd* that matched sd0, sd1, sd2,
and sd3' and things like `drive ? that became drive 1'.  This is
the semi-obvious difference, and is the one that is more useful,
yet also much more difficult to deal with.  Suppose, for instance,
that you want to use this to configure a kernel that will always
find <target 0 lun 0 on adapter aha0 at port 330> as `sd0', but
can still wildcard-match other disks.  This desire *cannot* be
found in any kernel data structures -- the kernel data can only
tell you that sd0 was found at lun 0 which is at target 0 which is
at aha0 which is at port 330, and whether the desire is to have
*that* disk be sd0, or just any `target 0 lun 0' that is on *any*
controller (e.g., aha, bha, or sa) that is at port 330.  Maybe the
actual desire is to have <0,0> on any Adaptec controller be sd0.
These desires, whatever they may be, exist only in the mind of the
guy who assembles the machines.

Finally, if you just want the locators that were used to configure
the kernel, well, those are in the config file used to configure
the kernel! :-)