On Sun, Dec 29, 2019 at 05:58:02AM +0100, Klemens Nanni wrote: > Now I need to work around the first digit's mismatch; for reasons still > unknown to me, official documentation states that the RAID volume WWID's > first digit --if it is zero-- must be replaced with three, so the > bootpath contains 3aa32290d5dcd16c whereas the port WWN has the correct > aa32290d5dcd16c. > > Fix that and the kernel will match the device and find its root device > automatically. I get around to a diff for that now. https://jp.fujitsu.com/platform/server/sparc/manual/en/c120-e679/14.2.12.html is the only freely available documentation I could find online which mentions how to craft bootpaths for RAID volumes.
It says Replace the number "0" at the beginning of WWID of the RAID volume with "3". which implies to me that every WWID of such RAID volumes starts with zero, hence it must always be replaced three; otherwise documentation is incomplete. I cannot find documentation or any kind of reasoning as to *why* this must be done, anyone who knows please enlighten me. So to match these, simply add an additional check in the existing code path for Fibre channel with already does what we want for hardware RAID. This is the second of three diffs for autoconf(9) to find the root device automatically, jmatthew previously sent the first one. Third one follows in a separate mail. Feedback? OK? Index: sparc64/autoconf.c =================================================================== RCS file: /cvs/src/sys/arch/sparc64/sparc64/autoconf.c,v retrieving revision 1.133 diff -u -p -r1.133 autoconf.c --- sparc64/autoconf.c 15 Oct 2019 05:21:16 -0000 1.133 +++ sparc64/autoconf.c 29 Dec 2019 06:05:44 -0000 @@ -1455,8 +1455,9 @@ device_register(struct device *dev, void u_int lun = bp->val[1]; if (bp->val[0] & 0xffffffff00000000 && bp->val[0] != -1) { - /* Fibre channel? */ - if (bp->val[0] == sl->port_wwn && lun == sl->lun) { + /* Hardware RAID or Fibre channel? */ + if ((bp->val[0] == sl->port_wwn + 0x3000000000000000 || + bp->val[0] == sl->port_wwn) && lun == sl->lun) { nail_bootdev(dev, bp); }