summaryrefslogtreecommitdiffstats
path: root/sys/geom/part
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-06-12 04:43:34 +0000
committermarcel <marcel@FreeBSD.org>2008-06-12 04:43:34 +0000
commit964e8e52e868c699ba9efe44a660a4f0fd7c719e (patch)
tree2df5f5aa7aa8a7ea483fe34c9f081d48677331da /sys/geom/part
parentcce3cf69a60f0dcaff45b8286f4d5dc15eb9e65d (diff)
downloadFreeBSD-src-964e8e52e868c699ba9efe44a660a4f0fd7c719e.zip
FreeBSD-src-964e8e52e868c699ba9efe44a660a4f0fd7c719e.tar.gz
Add the partition label and the raw partition type to the XML.
Diffstat (limited to 'sys/geom/part')
-rw-r--r--sys/geom/part/g_part_apm.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c
index 34647c3..6ffc58c 100644
--- a/sys/geom/part/g_part_apm.c
+++ b/sys/geom/part/g_part_apm.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2006, 2007 Marcel Moolenaar
+ * Copyright (c) 2006-2008 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -235,13 +235,27 @@ static int
g_part_apm_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry,
struct sbuf *sb, const char *indent)
{
+ union {
+ char name[APM_ENT_NAMELEN + 1];
+ char type[APM_ENT_TYPELEN + 1];
+ } u;
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);
+ if (indent == NULL) {
+ /* conftxt: libdisk compatibility */
+ sbuf_printf(sb, " xs APPLE xt %s", entry->ent.ent_type);
+ } else if (entry != NULL) {
+ /* confxml: partition entry information */
+ strncpy(u.name, entry->ent.ent_name, APM_ENT_NAMELEN);
+ u.name[APM_ENT_NAMELEN] = '\0';
+ sbuf_printf(sb, "%s<label>%s</label>\n", indent, u.name);
+ strncpy(u.type, entry->ent.ent_type, APM_ENT_TYPELEN);
+ u.type[APM_ENT_TYPELEN] = '\0';
+ sbuf_printf(sb, "%s<rawtype>%s</rawtype>\n", indent, u.type);
+ } else {
+ /* confxml: scheme information */
+ }
return (0);
}
OpenPOWER on IntegriCloud