From cf23147053bcf3b07f0282aebfc0189db00946d9 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 6 Jun 2007 05:06:14 +0000 Subject: [PATCH] Prefix unknown (i.e. un-aliased) partition types with '!'. This is how they had to be given with ctlreq. --- sys/geom/part/g_part_apm.c | 7 ++++--- sys/geom/part/g_part_gpt.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c index 50d5c1ee3d1..8b2fbc8f72d 100644 --- a/sys/geom/part/g_part_apm.c +++ b/sys/geom/part/g_part_apm.c @@ -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); } diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index 9f627b7b971..c3072bc6cd6 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -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); }