From owner-svn-src-projects@FreeBSD.ORG Sun Jan 13 23:58:41 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03E2A82B; Sun, 13 Jan 2013 23:58:41 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id CFBE473E; Sun, 13 Jan 2013 23:58:40 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from wanderer.tachypleus.net (c-24-63-204-107.hsd1.ct.comcast.net [24.63.204.107]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MGL0014Q99OVZ20@smtpauth3.wiscmail.wisc.edu>; Sun, 13 Jan 2013 17:58:39 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.13.234527, SenderIP=24.63.204.107 X-Spam-Report: AuthenticatedSender=yes, SenderIP=24.63.204.107 X-Wisc-Sender: whitehorn@wisc.edu Message-id: <50F34A2B.3080202@freebsd.org> Date: Sun, 13 Jan 2013 15:58:35 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130112 Thunderbird/17.0.2 To: Marcel Moolenaar Subject: Re: svn commit: r245399 - projects/altix2/sys/geom/part References: <201301132336.r0DNaLb7038996@svn.freebsd.org> In-reply-to: <201301132336.r0DNaLb7038996@svn.freebsd.org> Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 23:58:41 -0000 Why not make this a GEOM flag? -Nathan On 01/13/13 15:36, Marcel Moolenaar wrote: > Author: marcel > Date: Sun Jan 13 23:36:21 2013 > New Revision: 245399 > URL: http://svnweb.freebsd.org/changeset/base/245399 > > Log: > Marking the PMBR as active may be needed for some BIOSes to boot from the > disk, but also has some EFI implementations reject the GPT altogether. > Make the behaviour controllable by a sysctll and have it default to 1 > on i386 and amd64 and 0 otherwise. This means that we mark the PMBR as > active on i386 and amd64 by default, but remain compliant most of the > time. > > Modified: > projects/altix2/sys/geom/part/g_part_gpt.c > > Modified: projects/altix2/sys/geom/part/g_part_gpt.c > ============================================================================== > --- projects/altix2/sys/geom/part/g_part_gpt.c Sun Jan 13 23:00:40 2013 (r245398) > +++ projects/altix2/sys/geom/part/g_part_gpt.c Sun Jan 13 23:36:21 2013 (r245399) > @@ -50,6 +50,20 @@ __FBSDID("$FreeBSD$"); > > FEATURE(geom_part_gpt, "GEOM partitioning class for GPT partitions support"); > > +SYSCTL_DECL(_kern_geom_part); > +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, gpt, CTLFLAG_RW, 0, > + "gpart GPT controls"); > + > +#if defined(__i386__) || defined(__amd64__) > +#define PMBR_ACTIVE 1 > +#else > +#define PMBR_ACTIVE 0 > +#endif > + > +static u_int gpt_mark_pmbr_active = PMBR_ACTIVE; > +SYSCTL_UINT(_kern_geom_part_gpt, OID_AUTO, mark_pmbr_active, CTLFLAG_RW, > + &gpt_mark_pmbr_active, 0, "Mark the PMBR active on creation"); > + > CTASSERT(offsetof(struct gpt_hdr, padding) == 92); > CTASSERT(sizeof(struct gpt_ent) == 128); > > @@ -1040,7 +1054,8 @@ g_part_gpt_write(struct g_part_table *ba > gpt_write_mbr_entry(table->mbr, 0, 0xee, 1, > MIN(pp->mediasize / pp->sectorsize - 1, UINT32_MAX)); > /* Mark the PMBR active since some BIOS require it. */ > - table->mbr[DOSPARTOFF] = 0x80; > + if (gpt_mark_pmbr_active) > + table->mbr[DOSPARTOFF] = 0x80; > } > le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC); > >