Detect Apple HFS GPT slices.

This commit is contained in:
Rui Paulo 2008-09-05 12:49:14 +00:00
parent 3448d11d50
commit d7255ff42e
3 changed files with 9 additions and 1 deletions

View file

@ -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 }
};
/*

View file

@ -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
};

View file

@ -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);
}