From 964e8e52e868c699ba9efe44a660a4f0fd7c719e Mon Sep 17 00:00:00 2001 From: marcel Date: Thu, 12 Jun 2008 04:43:34 +0000 Subject: Add the partition label and the raw partition type to the XML. --- sys/geom/part/g_part_apm.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'sys/geom/part') 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\n", indent, u.name); + strncpy(u.type, entry->ent.ent_type, APM_ENT_TYPELEN); + u.type[APM_ENT_TYPELEN] = '\0'; + sbuf_printf(sb, "%s%s\n", indent, u.type); + } else { + /* confxml: scheme information */ + } return (0); } -- cgit v1.1