From owner-svn-src-all@FreeBSD.ORG Mon Aug 25 12:49:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E190F3E7; Mon, 25 Aug 2014 12:49:10 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC33A3761; Mon, 25 Aug 2014 12:49:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7PCnA1H076890; Mon, 25 Aug 2014 12:49:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7PCnAih076888; Mon, 25 Aug 2014 12:49:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201408251249.s7PCnAih076888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 25 Aug 2014 12:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270552 - in stable/10: sbin/geom/class/part sys/geom/part X-SVN-Group: stable-10 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.18-1 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, 25 Aug 2014 12:49:11 -0000 Author: ae Date: Mon Aug 25 12:49:10 2014 New Revision: 270552 URL: http://svnweb.freebsd.org/changeset/base/270552 Log: MFC r268407 (by gjb): Fix non-version text after .Fx macro usage. MFC r269487 (by issyl0): Add generic list, status, load and unload docs to gpart(8) - In the style of gmirror(8). PR: docs/191534 MFC r269852: Add sysctl and loader tunable kern.geom.part.mbr.enforce_chs that is set by default. It can be used to disable automatic alignment to CHS geometry, that GEOM_PART_MBR does. Modified: stable/10/sbin/geom/class/part/gpart.8 stable/10/sys/geom/part/g_part_mbr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/10/sbin/geom/class/part/gpart.8 Mon Aug 25 11:46:46 2014 (r270551) +++ stable/10/sbin/geom/class/part/gpart.8 Mon Aug 25 12:49:10 2014 (r270552) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2014 +.Dd August 12, 2014 .Dt GPART 8 .Os .Sh NAME @@ -129,6 +129,14 @@ .Op Fl f Ar flags .Ar geom .\" +.Nm +.Cm list +.Nm +.Cm status +.Nm +.Cm load +.Nm +.Cm unload .Sh DESCRIPTION The .Nm @@ -467,6 +475,18 @@ See the section entitled below for a discussion about its use. .El +.It Cm list +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . +.It Cm load +See +.Xr geom 8 . +.It Cm unload +See +.Xr geom 8 . .El .Sh PARTITIONING SCHEMES Several partitioning schemes are supported by the @@ -551,7 +571,8 @@ The utility also allows the user to specify scheme-specific partition types for partition types that do not have symbolic names. Symbolic names currently understood and used by -.Fx are: +.Fx +are: .Bl -tag -width ".Cm dragonfly-disklabel64" .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. @@ -1144,6 +1165,12 @@ If this variable set to 1 each component present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. +.It Va kern.geom.part.mbr.enforce_chs : No 1 +Specify how the Master Boot Record (MBR) module does alignment. +If this variable is set to a non-zero value, the module will automatically +recalculate the user-specified offset and size for alignment with the CHS +geometry. +Otherwise the values will be left unchanged. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. Modified: stable/10/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/10/sys/geom/part/g_part_mbr.c Mon Aug 25 11:46:46 2014 (r270551) +++ stable/10/sys/geom/part/g_part_mbr.c Mon Aug 25 12:49:10 2014 (r270552) @@ -49,6 +49,14 @@ __FBSDID("$FreeBSD$"); FEATURE(geom_part_mbr, "GEOM partitioning class for MBR support"); +SYSCTL_DECL(_kern_geom_part); +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, mbr, CTLFLAG_RW, 0, + "GEOM_PART_MBR Master Boot Record"); + +static u_int enforce_chs = 1; +SYSCTL_UINT(_kern_geom_part_mbr, OID_AUTO, enforce_chs, + CTLFLAG_RWTUN, &enforce_chs, 1, "Enforce alignment to CHS addressing"); + #define MBRSIZE 512 struct g_part_mbr_table { @@ -200,6 +208,8 @@ mbr_align(struct g_part_table *basetable { uint32_t sectors; + if (enforce_chs == 0) + return (0); sectors = basetable->gpt_sectors; if (*size < sectors) return (EINVAL);