diff options
author | marcel <marcel@FreeBSD.org> | 2008-09-27 19:58:11 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-09-27 19:58:11 +0000 |
commit | 42ef15f1c440ff74dd63cf17378671e2c69f7e7b (patch) | |
tree | aa1e1fdc8d7f10c8d20ff3471cc8319fb4de37f7 /sys/geom/part/g_part_pc98.c | |
parent | 0cc6ca46af6d1bf2fca0798f132bbac494d49f8f (diff) | |
download | FreeBSD-src-42ef15f1c440ff74dd63cf17378671e2c69f7e7b.zip FreeBSD-src-42ef15f1c440ff74dd63cf17378671e2c69f7e7b.tar.gz |
Export the partition name in the conftxt and confxml output.
The conftxt output is used by libdisk, and the confxml
output is used by gpart itself (gpart show -l).
Submitted by: nyan@
Diffstat (limited to 'sys/geom/part/g_part_pc98.c')
-rw-r--r-- | sys/geom/part/g_part_pc98.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/geom/part/g_part_pc98.c b/sys/geom/part/g_part_pc98.c index ff7e984..4a763de 100644 --- a/sys/geom/part/g_part_pc98.c +++ b/sys/geom/part/g_part_pc98.c @@ -241,19 +241,25 @@ 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; + char name[sizeof(entry->ent.dp_name) + 1]; u_int type; entry = (struct g_part_pc98_entry *)baseentry; + if (entry == NULL) { + /* confxml: scheme information */ + return (0); + } + + type = entry->ent.dp_mid + (entry->ent.dp_sid << 8); + strncpy(name, entry->ent.dp_name, sizeof(name) - 1); + name[sizeof(name) - 1] = '\0'; if (indent == NULL) { /* conftxt: libdisk compatibility */ - type = entry->ent.dp_mid + (entry->ent.dp_sid << 8); - sbuf_printf(sb, " xs PC98 xt %u", type); - } else if (entry != NULL) { + sbuf_printf(sb, " xs PC98 xt %u sn %s", type, name); + } else { /* confxml: partition entry information */ - type = entry->ent.dp_mid + (entry->ent.dp_sid << 8); + sbuf_printf(sb, "%s<label>%s</label>\n", indent, name); sbuf_printf(sb, "%s<rawtype>%u</rawtype>\n", indent, type); - } else { - /* confxml: scheme information */ } return (0); } |