Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Mar 2014 09:34:47 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r263964 - stable/10/sys/boot/common
Message-ID:  <201403310934.s2V9Ylxg099447@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Mar 31 09:34:46 2014
New Revision: 263964
URL: http://svnweb.freebsd.org/changeset/base/263964

Log:
  MFC r263468:
    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

Modified:
  stable/10/sys/boot/common/part.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/boot/common/part.c
==============================================================================
--- stable/10/sys/boot/common/part.c	Mon Mar 31 02:53:15 2014	(r263963)
+++ stable/10/sys/boot/common/part.c	Mon Mar 31 09:34:46 2014	(r263964)
@@ -634,7 +634,7 @@ ptable_open(void *dev, off_t sectors, ui
 	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, ui
 			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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403310934.s2V9Ylxg099447>