summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2014-03-21 09:29:01 +0000
committerae <ae@FreeBSD.org>2014-03-21 09:29:01 +0000
commit5c8976a1c14ecbf6318f87368b6b28e5d5f4beb4 (patch)
tree2374b557f98e24856fba65e58a0049cf5ce7448b /sys/boot/common
parent7dc00b854cfd013cf5e22bd69e8e3cead200f3dc (diff)
downloadFreeBSD-src-5c8976a1c14ecbf6318f87368b6b28e5d5f4beb4.zip
FreeBSD-src-5c8976a1c14ecbf6318f87368b6b28e5d5f4beb4.tar.gz
When loader(8) inspects MBR, it chooses GPT as main partition table,
when MBR contains only PMBR entry or it is bootcamp-compatible. If MBR has PMBR entry and some other, the loader rejects it. Make these checks to be less strict. If loader decided that PMBR isn't suitable for GPT, it will use MBR. Reported by: Paul Thornton Tested by: Paul Thornton MFC after: 1 week
Diffstat (limited to 'sys/boot/common')
-rw-r--r--sys/boot/common/part.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/boot/common/part.c b/sys/boot/common/part.c
index d37eee5..55153aa 100644
--- a/sys/boot/common/part.c
+++ b/sys/boot/common/part.c
@@ -634,7 +634,7 @@ ptable_open(void *dev, off_t sectors, uint16_t sectorsize,
for (i = 0, count = 0; i < NDOSPART; i++) {
if (dp[i].dp_flag != 0 && dp[i].dp_flag != 0x80) {
DEBUG("invalid partition flag %x", dp[i].dp_flag);
- break;
+ goto out;
}
#ifdef LOADER_GPT_SUPPORT
if (dp[i].dp_typ == DOSPTYP_PMBR) {
@@ -646,15 +646,12 @@ ptable_open(void *dev, off_t sectors, uint16_t sectorsize,
count++;
}
/* Do we have some invalid values? */
- if (i != NDOSPART ||
- (table->type == PTABLE_GPT && count > 1)) {
+ if (table->type == PTABLE_GPT && count > 1) {
if (dp[1].dp_typ != DOSPTYP_HFS) {
table->type = PTABLE_NONE;
- DEBUG("invalid values detected, ignore "
- "partition table");
- goto out;
- }
- DEBUG("Bootcamp detected");
+ DEBUG("Incorrect PMBR, ignore it");
+ } else
+ DEBUG("Bootcamp detected");
}
#ifdef LOADER_GPT_SUPPORT
if (table->type == PTABLE_GPT) {
OpenPOWER on IntegriCloud