From owner-svn-src-all@FreeBSD.ORG Mon Oct 22 11:01:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4BB67F5C; Mon, 22 Oct 2012 11:01:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34EC18FC08; Mon, 22 Oct 2012 11:01:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9MB1iwp096251; Mon, 22 Oct 2012 11:01:44 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9MB1hjS096249; Mon, 22 Oct 2012 11:01:44 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201210221101.q9MB1hjS096249@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 22 Oct 2012 11:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241876 - 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.14 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: Mon, 22 Oct 2012 11:01:44 -0000 Author: ae Date: Mon Oct 22 11:01:43 2012 New Revision: 241876 URL: http://svn.freebsd.org/changeset/base/241876 Log: When loader tries to open GPT partition, but partition table is not GPT, then try automatically detect an appropriate partition type. PR: kern/172550 Tested by: Ralf Wenk Modified: head/sys/boot/common/disk.c Modified: head/sys/boot/common/disk.c ============================================================================== --- head/sys/boot/common/disk.c Mon Oct 22 10:53:59 2012 (r241875) +++ head/sys/boot/common/disk.c Mon Oct 22 11:01:43 2012 (r241876) @@ -310,6 +310,13 @@ opened: if (ptable_gettype(od->table) == PTABLE_GPT) { partition = 255; goto out; /* Nothing more to do */ + } else if (partition == 255) { + /* + * When we try to open GPT partition, but partition + * table isn't GPT, reset d_partition value to -1 + * and try to autodetect appropriate value. + */ + partition = -1; } /* * If d_partition < 0 and we are looking at a BSD slice,