aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2018-02-11 06:57:20 +0000
committerConrad Meyer <cem@FreeBSD.org>2018-02-11 06:57:20 +0000
commitb42712a8b77881b9c2a70976de2f388c5a9ddb2f (patch)
tree96fbd8673df57a1293f213ec60f516e4f5ed14e5
parente6c00555997cd2cf85870160530e5e8a9690f6ec (diff)
downloadsrc-b42712a8b77881b9c2a70976de2f388c5a9ddb2f.tar.gz
src-b42712a8b77881b9c2a70976de2f388c5a9ddb2f.zip
Add GUID and alias for Apple APFS partition
PR: 225813 Submitted by: James Wright <james.wright AT jigsawdezign.com>
Notes
Notes: svn path=/head/; revision=329119
-rw-r--r--sbin/geom/class/part/gpart.84
-rw-r--r--sys/geom/part/g_part.c1
-rw-r--r--sys/geom/part/g_part.h1
-rw-r--r--sys/geom/part/g_part_gpt.c2
-rw-r--r--sys/sys/disk/gpt.h2
5 files changed, 9 insertions, 1 deletions
diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8
index e0199cb4f317..aa7db432c80b 100644
--- a/sbin/geom/class/part/gpart.8
+++ b/sbin/geom/class/part/gpart.8
@@ -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.
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index de79be297429..ae76e10c6578 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -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 },
diff --git a/sys/geom/part/g_part.h b/sys/geom/part/g_part.h
index 67d0168cbda4..43a796a429c1 100644
--- a/sys/geom/part/g_part.h
+++ b/sys/geom/part/g_part.h
@@ -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. */
diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c
index b0a7682a28c0..c2f772406614 100644
--- a/sys/geom/part/g_part_gpt.c
+++ b/sys/geom/part/g_part_gpt.c
@@ -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 },
diff --git a/sys/sys/disk/gpt.h b/sys/sys/disk/gpt.h
index a3df2927beec..ce38a1d1036a 100644
--- a/sys/sys/disk/gpt.h
+++ b/sys/sys/disk/gpt.h
@@ -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}}