summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2011-04-27 09:41:00 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2011-04-27 09:41:00 +0000
commitdea77577d1b65aaec5c160bceb0c382335a9c61c (patch)
tree79ab6312e1507ae6e2f30136d0ef86f22a4f4a85 /sys
parent333f0c314bba106fa93dcdf4b35e0a33021baba6 (diff)
support rooting off multipath disks.
if you boot from a disk that ends up behind mpath(4) on sparc64, it wont be able to resolve it to the actual disk device since a path driver (eg sym(4)) sits where ofw tells us a disk is. this diff allows the bootpath code to match on path drivers, and then asks mpath to swap the path for the disk device. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/sparc64/autoconf.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c
index af4b2326d49..e07581a9c67 100644
--- a/sys/arch/sparc64/sparc64/autoconf.c
+++ b/sys/arch/sparc64/sparc64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.110 2011/04/07 15:30:16 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.111 2011/04/27 09:40:59 dlg Exp $ */
/* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */
/*
@@ -44,6 +44,8 @@
* @(#)autoconf.c 8.4 (Berkeley) 10/1/93
*/
+#include "mpath.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
@@ -84,6 +86,9 @@
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
+#if NMPATH > 0
+#include <scsi/mpathvar.h>
+#endif
#ifdef DDB
#include <machine/db_machdep.h>
@@ -702,6 +707,11 @@ diskconf(void)
bp = nbootpath == 0 ? NULL : &bootpath[nbootpath-1];
bootdv = (bp == NULL) ? NULL : bp->dev;
+#if NMPATH > 0
+ if (bootdv != NULL)
+ bootdv = mpath_bootdv(bootdv);
+#endif
+
setroot(bootdv, bp->val[2], RB_USERREQ | RB_HALT);
dumpconf();
}
@@ -1363,7 +1373,7 @@ device_register(struct device *dev, void *aux)
}
}
- if (strcmp(devname, "sd") == 0 || strcmp(devname, "cd") == 0) {
+ if (strcmp(busname, "scsibus") == 0) {
/*
* A SCSI disk or cd; retrieve target/lun information
* from parent and match with current bootpath component.