diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index f05d75054d98..68b2515277f3 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -1489,6 +1489,13 @@ g_part_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, sbuf_printf(sb, " i %u o %ju ty %s", entry->gpe_index, (uintmax_t)entry->gpe_offset, G_PART_TYPE(table, entry, buf, sizeof(buf))); + /* + * libdisk compatibility quirk - the scheme dumps the + * slicer name and partition type in a way that is + * compatible with libdisk. When libdisk is not used + * anymore, this should go away. + */ + G_PART_DUMPCONF(table, entry, sb, indent); } else if (cp != NULL) { /* Consumer configuration. */ KASSERT(pp == NULL, (__func__)); /* none */ diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c index 3b4ec7355a89..34647c341e8c 100644 --- a/sys/geom/part/g_part_apm.c +++ b/sys/geom/part/g_part_apm.c @@ -61,6 +61,8 @@ static int g_part_apm_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static int g_part_apm_create(struct g_part_table *, struct g_part_parms *); static int g_part_apm_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_apm_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_apm_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_apm_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -76,6 +78,7 @@ static kobj_method_t g_part_apm_methods[] = { KOBJMETHOD(g_part_add, g_part_apm_add), KOBJMETHOD(g_part_create, g_part_apm_create), KOBJMETHOD(g_part_destroy, g_part_apm_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_apm_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_apm_dumpto), KOBJMETHOD(g_part_modify, g_part_apm_modify), KOBJMETHOD(g_part_name, g_part_apm_name), @@ -228,6 +231,20 @@ g_part_apm_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) return (0); } +static int +g_part_apm_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, + struct sbuf *sb, const char *indent) +{ + struct g_part_apm_entry *entry; + + if (indent != NULL) + return (0); + + entry = (struct g_part_apm_entry *)baseentry; + sbuf_printf(sb, " xs APPLE xt %s", entry->ent.ent_type); + return (0); +} + static int g_part_apm_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c index 533cd5074f6c..24f896e6c99b 100644 --- a/sys/geom/part/g_part_bsd.c +++ b/sys/geom/part/g_part_bsd.c @@ -60,6 +60,8 @@ static int g_part_bsd_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static int g_part_bsd_create(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_bsd_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_bsd_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -75,6 +77,7 @@ static kobj_method_t g_part_bsd_methods[] = { KOBJMETHOD(g_part_add, g_part_bsd_add), KOBJMETHOD(g_part_create, g_part_bsd_create), KOBJMETHOD(g_part_destroy, g_part_bsd_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_bsd_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_bsd_dumpto), KOBJMETHOD(g_part_modify, g_part_bsd_modify), KOBJMETHOD(g_part_name, g_part_bsd_name), @@ -213,6 +216,20 @@ g_part_bsd_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) return (0); } +static int +g_part_bsd_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, + struct sbuf *sb, const char *indent) +{ + struct g_part_bsd_entry *entry; + + if (indent != NULL) + return (0); + + entry = (struct g_part_bsd_entry *)baseentry; + sbuf_printf(sb, " xs BSD xt %u", entry->part.p_fstype); + return (0); +} + static int g_part_bsd_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index cc9cdfc5712a..d2df4204adc9 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -88,6 +88,8 @@ static int g_part_gpt_add(struct g_part_table *, struct g_part_entry *, static int g_part_gpt_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_gpt_create(struct g_part_table *, struct g_part_parms *); static int g_part_gpt_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_gpt_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_gpt_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_gpt_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -104,6 +106,7 @@ static kobj_method_t g_part_gpt_methods[] = { KOBJMETHOD(g_part_bootcode, g_part_gpt_bootcode), KOBJMETHOD(g_part_create, g_part_gpt_create), KOBJMETHOD(g_part_destroy, g_part_gpt_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_gpt_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_gpt_dumpto), KOBJMETHOD(g_part_modify, g_part_gpt_modify), KOBJMETHOD(g_part_name, g_part_gpt_name), @@ -429,6 +432,21 @@ g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) return (0); } +static int +g_part_gpt_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, + struct sbuf *sb, const char *indent) +{ + struct g_part_gpt_entry *entry; + + if (indent != NULL) + return (0); + + entry = (struct g_part_gpt_entry *)baseentry; + sbuf_printf(sb, " xs GPT xt "); + sbuf_printf_uuid(sb, &entry->ent.ent_type); + return (0); +} + static int g_part_gpt_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 5741b1581e73..b4c625dc0221 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -62,6 +62,8 @@ static int g_part_mbr_add(struct g_part_table *, struct g_part_entry *, static int g_part_mbr_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_mbr_create(struct g_part_table *, struct g_part_parms *); static int g_part_mbr_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_mbr_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_mbr_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_mbr_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -78,6 +80,7 @@ static kobj_method_t g_part_mbr_methods[] = { KOBJMETHOD(g_part_bootcode, g_part_mbr_bootcode), KOBJMETHOD(g_part_create, g_part_mbr_create), KOBJMETHOD(g_part_destroy, g_part_mbr_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_mbr_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_mbr_dumpto), KOBJMETHOD(g_part_modify, g_part_mbr_modify), KOBJMETHOD(g_part_name, g_part_mbr_name), @@ -245,6 +248,20 @@ g_part_mbr_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) return (0); } +static int +g_part_mbr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, + struct sbuf *sb, const char *indent) +{ + struct g_part_mbr_entry *entry; + + if (indent != NULL) + return (0); + + entry = (struct g_part_mbr_entry *)baseentry; + sbuf_printf(sb, " xs MBR xt %u", entry->ent.dp_typ); + return (0); +} + static int g_part_mbr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { diff --git a/sys/geom/part/g_part_pc98.c b/sys/geom/part/g_part_pc98.c index 05d56f3f4365..0c98241f104d 100644 --- a/sys/geom/part/g_part_pc98.c +++ b/sys/geom/part/g_part_pc98.c @@ -63,6 +63,8 @@ static int g_part_pc98_add(struct g_part_table *, struct g_part_entry *, static int g_part_pc98_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_pc98_create(struct g_part_table *, struct g_part_parms *); static int g_part_pc98_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_pc98_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_pc98_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_pc98_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -79,6 +81,7 @@ static kobj_method_t g_part_pc98_methods[] = { KOBJMETHOD(g_part_bootcode, g_part_pc98_bootcode), KOBJMETHOD(g_part_create, g_part_pc98_create), KOBJMETHOD(g_part_destroy, g_part_pc98_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_pc98_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_pc98_dumpto), KOBJMETHOD(g_part_modify, g_part_pc98_modify), KOBJMETHOD(g_part_name, g_part_pc98_name), @@ -233,6 +236,21 @@ g_part_pc98_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) return (0); } +static int +g_part_pc98_dumpconf(struct g_part_table *table, + struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) +{ + struct g_part_pc98_entry *entry; + u_int type; + if (indent != NULL) + return (0); + + entry = (struct g_part_pc98_entry *)baseentry; + type = entry->ent.dp_mid + (entry->ent.dp_sid << 8); + sbuf_printf(sb, " xs PC98 xt %u", type); + return (0); +} + static int g_part_pc98_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { diff --git a/sys/geom/part/g_part_vtoc8.c b/sys/geom/part/g_part_vtoc8.c index 05804c72c6fc..efe6d44898ea 100644 --- a/sys/geom/part/g_part_vtoc8.c +++ b/sys/geom/part/g_part_vtoc8.c @@ -55,6 +55,8 @@ static int g_part_vtoc8_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static int g_part_vtoc8_create(struct g_part_table *, struct g_part_parms *); static int g_part_vtoc8_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_vtoc8_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_vtoc8_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_vtoc8_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -70,6 +72,7 @@ static kobj_method_t g_part_vtoc8_methods[] = { KOBJMETHOD(g_part_add, g_part_vtoc8_add), KOBJMETHOD(g_part_create, g_part_vtoc8_create), KOBJMETHOD(g_part_destroy, g_part_vtoc8_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_vtoc8_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_vtoc8_dumpto), KOBJMETHOD(g_part_modify, g_part_vtoc8_modify), KOBJMETHOD(g_part_name, g_part_vtoc8_name), @@ -235,6 +238,22 @@ g_part_vtoc8_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) return (0); } +static int +g_part_vtoc8_dumpconf(struct g_part_table *basetable, + struct g_part_entry *entry, struct sbuf *sb, const char *indent) +{ + struct g_part_vtoc8_table *table; + + if (indent != NULL) + return (0); + + table = (struct g_part_vtoc8_table *)basetable; + sbuf_printf(sb, " xs SUN sc %u hd %u alt %u", + be16dec(&table->vtoc.nsecs), be16dec(&table->vtoc.nheads), + be16dec(&table->vtoc.altcyls)); + return (0); +} + static int g_part_vtoc8_dumpto(struct g_part_table *basetable, struct g_part_entry *entry) {