summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2012-10-08 14:15:24 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2012-10-08 14:15:24 +0000
commitd761a819b77d84f1dff67e475b61fc7afaf73b86 (patch)
tree6aca22155439d2c4f259a0bea8b39a8fc61b4e5c
parent6223a5facab263274aa71293f592005b33bce0cf (diff)
If we have booted from a disk that is a member of a bootable softraid
volume, always select the srX device unless the 'a' partition of the disk is FFS.
-rw-r--r--sys/arch/amd64/stand/libsa/dev_i386.c18
-rw-r--r--sys/arch/amd64/stand/libsa/disk.h7
2 files changed, 18 insertions, 7 deletions
diff --git a/sys/arch/amd64/stand/libsa/dev_i386.c b/sys/arch/amd64/stand/libsa/dev_i386.c
index 9e735291c22..de47768763f 100644
--- a/sys/arch/amd64/stand/libsa/dev_i386.c
+++ b/sys/arch/amd64/stand/libsa/dev_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev_i386.c,v 1.10 2012/03/19 15:20:16 jsing Exp $ */
+/* $OpenBSD: dev_i386.c,v 1.11 2012/10/08 14:15:23 jsing Exp $ */
/*
* Copyright (c) 1996-1999 Michael Shalayeff
@@ -96,7 +96,9 @@ devboot(dev_t bootdev, char *p)
{
struct sr_boot_volume *bv;
struct sr_boot_chunk *bc;
+ struct diskinfo *dip = NULL;
int sr_boot_vol = -1;
+ int part_type = FS_UNUSED;
#ifdef _TEST
*p++ = '/';
@@ -108,13 +110,19 @@ devboot(dev_t bootdev, char *p)
#endif
/*
+ * Determine the partition type for the 'a' partition of the
+ * boot device.
+ */
+ TAILQ_FOREACH(dip, &disklist, list)
+ if (dip->bios_info.bios_number == bootdev &&
+ (dip->bios_info.flags & BDI_BADLABEL) == 0)
+ part_type = dip->disklabel.d_partitions[0].p_fstype;
+
+ /*
* See if we booted from a disk that is a member of a bootable
* softraid volume.
*/
SLIST_FOREACH(bv, &sr_volumes, sbv_link) {
- /* For now we only support booting from RAID 1 volumes. */
- if (bv->sbv_level != 1)
- continue;
if (bv->sbv_flags & BIOC_SCBOOTABLE)
SLIST_FOREACH(bc, &bv->sbv_chunks, sbc_link)
if (bc->sbc_disk == bootdev)
@@ -123,7 +131,7 @@ devboot(dev_t bootdev, char *p)
break;
}
- if (sr_boot_vol != -1) {
+ if (sr_boot_vol != -1 && part_type != FS_BSDFFS) {
*p++ = 's';
*p++ = 'r';
*p++ = '0' + sr_boot_vol;
diff --git a/sys/arch/amd64/stand/libsa/disk.h b/sys/arch/amd64/stand/libsa/disk.h
index efb84c603d4..adbe02d0285 100644
--- a/sys/arch/amd64/stand/libsa/disk.h
+++ b/sys/arch/amd64/stand/libsa/disk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disk.h,v 1.2 2012/01/11 14:47:02 jsing Exp $ */
+/* $OpenBSD: disk.h,v 1.3 2012/10/08 14:15:23 jsing Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -44,9 +44,12 @@ struct diskinfo {
};
TAILQ_HEAD(disklist_lh, diskinfo);
-/* Head of this list. */
+/* Disk info for boot device. */
extern struct diskinfo *bootdev_dip;
+/* List of probed disks. */
+extern struct disklist_lh disklist;
+
/* List of softraid volumes. */
extern struct sr_boot_volume_head sr_volumes;