Add the freebsd-zfs alias. Both APM and GPT have ZFS partition

types.
This commit is contained in:
Marcel Moolenaar 2007-10-21 20:02:57 +00:00
parent b3f09ae457
commit a1fedf914f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=172857
4 changed files with 17 additions and 0 deletions

View File

@ -69,6 +69,7 @@ struct g_part_alias_list {
{ "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP },
{ "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 }
};

View File

@ -41,6 +41,7 @@ enum g_part_alias {
G_PART_ALIAS_FREEBSD_SWAP, /* A swap partition entry. */
G_PART_ALIAS_FREEBSD_UFS, /* A UFS/UFS2 file system entry. */
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. */
/* Keep the following last */
G_PART_ALIAS_COUNT

View File

@ -131,6 +131,11 @@ apm_parse_type(const char *type, char *buf, size_t bufsz)
strcpy(buf, APM_ENT_TYPE_FREEBSD_VINUM);
return (0);
}
alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS);
if (!strcasecmp(type, alias)) {
strcpy(buf, APM_ENT_TYPE_FREEBSD_ZFS);
return (0);
}
return (EINVAL);
}
@ -358,6 +363,8 @@ g_part_apm_type(struct g_part_table *basetable, struct g_part_entry *baseentry,
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD_VINUM))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD_ZFS))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS));
buf[0] = '!';
len = MIN(sizeof(entry->ent.ent_type), bufsz - 2);
bcopy(type, buf + 1, len);

View File

@ -124,6 +124,7 @@ static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD;
static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP;
static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
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_unused = GPT_ENT_TYPE_UNUSED;
@ -309,6 +310,11 @@ gpt_parse_type(const char *type, struct uuid *uuid)
*uuid = gpt_uuid_freebsd_vinum;
return (0);
}
alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS);
if (!strcasecmp(type, alias)) {
*uuid = gpt_uuid_freebsd_zfs;
return (0);
}
alias = g_part_alias_name(G_PART_ALIAS_MBR);
if (!strcasecmp(type, alias)) {
*uuid = gpt_uuid_mbr;
@ -600,6 +606,8 @@ g_part_gpt_type(struct g_part_table *basetable, struct g_part_entry *baseentry,
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS));
if (EQUUID(type, &gpt_uuid_freebsd_vinum))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM));
if (EQUUID(type, &gpt_uuid_freebsd_zfs))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS));
if (EQUUID(type, &gpt_uuid_mbr))
return (g_part_alias_name(G_PART_ALIAS_MBR));
buf[0] = '!';