From owner-svn-src-head@freebsd.org Sun Feb 11 06:57:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FE04F1BF36; Sun, 11 Feb 2018 06:57:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 501A187A29; Sun, 11 Feb 2018 06:57:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AFA21F74A; Sun, 11 Feb 2018 06:57:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1B6vLJs024577; Sun, 11 Feb 2018 06:57:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1B6vKvT024572; Sun, 11 Feb 2018 06:57:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802110657.w1B6vKvT024572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 11 Feb 2018 06:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329119 - in head: sbin/geom/class/part sys/geom/part sys/sys/disk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sbin/geom/class/part sys/geom/part sys/sys/disk X-SVN-Commit-Revision: 329119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 06:57:21 -0000 Author: cem Date: Sun Feb 11 06:57:20 2018 New Revision: 329119 URL: https://svnweb.freebsd.org/changeset/base/329119 Log: Add GUID and alias for Apple APFS partition PR: 225813 Submitted by: James Wright Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c head/sys/sys/disk/gpt.h Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Sun Feb 11 03:21:06 2018 (r329118) +++ head/sbin/geom/class/part/gpart.8 Sun Feb 11 06:57:20 2018 (r329119) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2017 +.Dd February 10, 2018 .Dt GPART 8 .Os .Sh NAME @@ -654,6 +654,8 @@ Another symbolic names that can be used with .Cm gpart utility are: .Bl -tag -width ".Cm dragonfly-disklabel64" +.It Cm apple-apfs +An Apple macOS partition used for the Apple file system, APFS. .It Cm apple-core-storage An Apple Mac OS X partition used by logical volume manager known as Core Storage. Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part.c Sun Feb 11 06:57:20 2018 (r329119) @@ -71,6 +71,7 @@ struct g_part_alias_list { const char *lexeme; enum g_part_alias alias; } g_part_alias_list[G_PART_ALIAS_COUNT] = { + { "apple-apfs", G_PART_ALIAS_APPLE_APFS }, { "apple-boot", G_PART_ALIAS_APPLE_BOOT }, { "apple-core-storage", G_PART_ALIAS_APPLE_CORE_STORAGE }, { "apple-hfs", G_PART_ALIAS_APPLE_HFS }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part.h Sun Feb 11 06:57:20 2018 (r329119) @@ -38,6 +38,7 @@ #define G_PART_PROBE_PRI_HIGH 0 enum g_part_alias { + G_PART_ALIAS_APPLE_APFS, /* An Apple APFS partition. */ G_PART_ALIAS_APPLE_BOOT, /* An Apple boot partition entry. */ G_PART_ALIAS_APPLE_CORE_STORAGE,/* An Apple Core Storage partition. */ G_PART_ALIAS_APPLE_HFS, /* An HFS+ file system entry. */ Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/geom/part/g_part_gpt.c Sun Feb 11 06:57:20 2018 (r329119) @@ -147,6 +147,7 @@ static struct g_part_scheme g_part_gpt_scheme = { }; G_PART_SCHEME_DECLARE(g_part_gpt); +static struct uuid gpt_uuid_apple_apfs = GPT_ENT_TYPE_APPLE_APFS; static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; static struct uuid gpt_uuid_apple_core_storage = GPT_ENT_TYPE_APPLE_CORE_STORAGE; @@ -208,6 +209,7 @@ static struct g_part_uuid_alias { int alias; int mbrtype; } gpt_uuid_alias_match[] = { + { &gpt_uuid_apple_apfs, G_PART_ALIAS_APPLE_APFS, 0 }, { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, { &gpt_uuid_apple_core_storage, G_PART_ALIAS_APPLE_CORE_STORAGE, 0 }, { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, Modified: head/sys/sys/disk/gpt.h ============================================================================== --- head/sys/sys/disk/gpt.h Sun Feb 11 03:21:06 2018 (r329118) +++ head/sys/sys/disk/gpt.h Sun Feb 11 06:57:20 2018 (r329119) @@ -183,6 +183,8 @@ CTASSERT(sizeof(struct gpt_ent) == 128); {0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_CORE_STORAGE \ {0x53746f72,0x6167,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_APFS \ + {0x7c3457ef,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_NETBSD_FFS \ {0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}}