From d7255ff42ebea07ea3a26b01ba6cd007025629dd Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Fri, 5 Sep 2008 12:49:14 +0000 Subject: [PATCH] Detect Apple HFS GPT slices. --- sys/geom/part/g_part.c | 3 ++- sys/geom/part/g_part.h | 1 + sys/geom/part/g_part_gpt.c | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index e12c0fa03c9..403d1c0f1cb 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -72,7 +72,8 @@ struct g_part_alias_list { { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, { "freebsd-zfs", G_PART_ALIAS_FREEBSD_ZFS }, - { "mbr", G_PART_ALIAS_MBR } + { "mbr", G_PART_ALIAS_MBR }, + { "hfs", G_PART_ALIAS_APPLE_HFS } }; /* diff --git a/sys/geom/part/g_part.h b/sys/geom/part/g_part.h index 94e17148857..8560845ddf5 100644 --- a/sys/geom/part/g_part.h +++ b/sys/geom/part/g_part.h @@ -44,6 +44,7 @@ enum g_part_alias { G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ G_PART_ALIAS_FREEBSD_ZFS, /* A ZFS file system entry. */ G_PART_ALIAS_MBR, /* A MBR (extended) partition entry. */ + G_PART_ALIAS_APPLE_HFS, /* An HFS file system entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index d700d0e8813..3a3179d0fe7 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -140,6 +140,7 @@ static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; static struct uuid gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; +static struct uuid gpt_uuid_apple_hfs = GPT_ENT_TYPE_APPLE_HFS; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; static void @@ -337,6 +338,11 @@ gpt_parse_type(const char *type, struct uuid *uuid) *uuid = gpt_uuid_mbr; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_APPLE_HFS); + if (!strcasecmp(type, alias)) { + *uuid = gpt_uuid_apple_hfs; + return (0); + } return (EINVAL); }