On Mon, 24 Sep 2018 at 11:08, Don NetBSD <netbsd-embed...@gmx.com> wrote: > > On 9/18/2018 3:54 AM, David Brownlee wrote: > > Just some musing about handling drive mappings: > > > > For sd devices you could use "scsictl sdX identify" to map back from > > sdX to (scsibus, target, lun) numbers and then onto each drive's > > physical location. > > OK. That would help me initially identify the "slots" in order to > hard-wire them in the kernel. I.e., stuff every slot, boot, then > "identify" each disk (having made the contents of each disk unique > enough to map to the probed devices). > > Presumably, once each slot is wired down, then it need not be > populated at boot -- yet the device will still exist for it when it > later "appears".
Yes, though if you can identify the slots for hardwiring into the kernel you could also run the same process at runtime as run a GENERIC kernel. I have no idea whether this would actually map to your real requirements, but a possible workflow could be: Bringing up new appliance ("slot mapping") - Assuming you have "ID" devices digitally and physically labelled 1..n. - User is directed to insert as many ID devices as they have slots switch on machine - Appliance boots, detects it has devices attached, checks to see they are ID devices, updates slots and records its slot mappings Normal use - When a new sdX or wdX device is detected system determines its slot mapping and uses it when talking to user - If it can't determine slot mapping, it suggests a new slot mapping pass (something strange has happened) Optional extra credit ("Where is what slot") - User is instructed to apply sticky number labels next to ID devices when bring up appliance Optional extra credit ("Where is what slot and sticky labels fall off") - User directed to take photo of appliance with ID devices to record where the slots were & upload to web server on applicance - If user is confused on slot mapping web server on appliance can show mapping picture Optional extra credit ("Users mess with hardware/swap disks to other machines") - At boot time system takes a copy of dmesg and notes the available atabus/scsibus and device names - If this ever changes it forces a new slot mapping pass David