Prefix unknown (i.e. un-aliased) partition types with '!'. This is

how they had to be given with ctlreq.
This commit is contained in:
Marcel Moolenaar 2007-06-06 05:06:14 +00:00
parent 33a558c7e9
commit cf23147053
2 changed files with 6 additions and 4 deletions

View file

@ -358,9 +358,10 @@ 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));
len = MIN(sizeof(entry->ent.ent_type), bufsz - 1);
bcopy(type, buf, len);
buf[len] = '\0';
buf[0] = '!';
len = MIN(sizeof(entry->ent.ent_type), bufsz - 2);
bcopy(type, buf + 1, len);
buf[len + 1] = '\0';
return (buf);
}

View file

@ -602,7 +602,8 @@ g_part_gpt_type(struct g_part_table *basetable, struct g_part_entry *baseentry,
return (g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM));
if (EQUUID(type, &gpt_uuid_mbr))
return (g_part_alias_name(G_PART_ALIAS_MBR));
snprintf_uuid(buf, bufsz, type);
buf[0] = '!';
snprintf_uuid(buf + 1, bufsz - 1, type);
return (buf);
}