From owner-svn-src-all@FreeBSD.ORG Fri Mar 21 09:29:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A99CE89; Fri, 21 Mar 2014 09:29:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC745F0D; Fri, 21 Mar 2014 09:29:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L9T1Ea024895; Fri, 21 Mar 2014 09:29:01 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L9T1BY024894; Fri, 21 Mar 2014 09:29:01 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201403210929.s2L9T1BY024894@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 21 Mar 2014 09:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263468 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 09:29:02 -0000 Author: ae Date: Fri Mar 21 09:29:01 2014 New Revision: 263468 URL: http://svnweb.freebsd.org/changeset/base/263468 Log: 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 Modified: head/sys/boot/common/part.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Fri Mar 21 05:37:25 2014 (r263467) +++ head/sys/boot/common/part.c Fri Mar 21 09:29:01 2014 (r263468) @@ -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) {