b...@bsd.de (Christoph Badura) writes: >> So, assuming 'raid0' has a component 'dk0' which is based on 'wd0', it >> should work to specify 'wd0' as bootdev.
>That does work. However, that is besides the point bootdev=raid0 is >supposed to work but it doesn't. Which is of course is unrelated to the raid autoconfig I talked about and which is flawed too. >The reason for that is in the code that overrides rootspec with bootspec. Not really, read below. >rootspec gets initialized by config(8) like so: >For "config <name> root on ?": >const char *rootspec = NULL; >dev_t rootdev = NODEV; /* wildcarded */ >And for, e.g., "config <name> root on sd0e": >const char *rootspec = "sd0e"; >dev_t rootdev = makedev(4, 4); /* sd0e */ rootspec is set by config(1) for three cases: config <name> root on major 4 minor 4 - sets rootspec to "sd0e" (or maybe "<4/4>") and rootdev to makedev(4,4) config <name> root on sd0e - sets rootspec to "sd0e" and rootdev to makedev(4,4) config <name> root on "some string constant" - sets rootspec to "some string constant" and rootdev to NODEV. If rootspec is set the kernel checks for - rootspec specifying a network interface -> network boot - rootdev == NODEV -> resolve rootspec (as a wedge name) - rootdev != NODEV -> Use rootdev, ignore rootspec but which is same as rootdev The intention is to resolve the 3 cases (network interface, disk device, wedge name), and rootspec basically overrides rootdev (in the second case they specify the same device, so nothing is "overridden" even when the code takes the rootdev value). >I.e. rootspec and rootdev need to be set in pairs. If rootspec isn't set by config(1), we talk about a wildcard boot and rootdev is already set to NODEV. So that's exactly the third case provided by config(1). And if I'm not mistaken then config <name> root on "raid0" doesn't work either. So we could - explicitely clear rootdev to NODEV to not rely on config(1) defaults when using bootspec. - make the code that resolves rootspec also handle regular disks and not just dk (and flash) devices. This also keeps that logic in a single place. -- -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."