summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2012-08-13 13:33:21 +0000
committerae <ae@FreeBSD.org>2012-08-13 13:33:21 +0000
commitd3ddd78f243be669ce965824d1ea3a1f4ca9158b (patch)
treeaa69ae07b1f0b585ec08fd1fe82495ae4446f6ec /sys/boot/common
parent258bfae1c8a4096870bd7c23c3dbe5176105ab24 (diff)
downloadFreeBSD-src-d3ddd78f243be669ce965824d1ea3a1f4ca9158b.zip
FreeBSD-src-d3ddd78f243be669ce965824d1ea3a1f4ca9158b.tar.gz
Restore the old behaviour. If requested partition is a BSD slice,
but d_partition isn't explicitly set, then try to open BSD label and its first partition.
Diffstat (limited to 'sys/boot/common')
-rw-r--r--sys/boot/common/disk.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/boot/common/disk.c b/sys/boot/common/disk.c
index a58eadf..9e4c78f 100644
--- a/sys/boot/common/disk.c
+++ b/sys/boot/common/disk.c
@@ -185,10 +185,18 @@ disk_open(struct disk_devdesc *dev, off_t mediasize, u_int sectorsize)
if (rc != 0) /* Partition doesn't exist */
goto out;
dev->d_offset = part.start;
- if (dev->d_partition == -1 ||
- dev->d_partition == 255)
+ if (dev->d_partition == 255)
goto out; /* Nothing more to do */
-
+ if (dev->d_partition == -1) {
+ /*
+ * If we are looking at a BSD slice, and the
+ * partition is < 0, assume the 'a' partition.
+ */
+ if (part.type == PART_FREEBSD)
+ dev->d_partition = 0;
+ else
+ goto out;
+ }
/* Try to read BSD label */
table = ptable_open(dev, part.end - part.start + 1,
od->sectorsize, ptblread);
OpenPOWER on IntegriCloud