summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-05-16 22:21:33 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-05-16 22:21:33 +0000
commit9090794d6cc9b8867376522131d6ff69824038a7 (patch)
treed1b866f7d301b4bec265f000dad8c55d69b27f08
parentb7a63fb85cd07072afa8e91201882f5a9c432e55 (diff)
downloadFreeBSD-src-9090794d6cc9b8867376522131d6ff69824038a7.zip
FreeBSD-src-9090794d6cc9b8867376522131d6ff69824038a7.tar.gz
Teach gpart about bootcode on APM.
-rw-r--r--sbin/geom/class/part/geom_part.c2
-rw-r--r--sys/geom/part/g_part_apm.c26
2 files changed, 27 insertions, 1 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index 3ddbd7a..6fca208 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -705,7 +705,7 @@ gpart_bootcode(struct gctl_req *req, unsigned int fl)
if (gctl_has_param(req, bootcode_param)) {
s = gctl_get_ascii(req, bootcode_param);
- bootsize = 64 * 1024; /* Arbitrary limit. */
+ bootsize = 800 * 1024; /* Arbitrary limit. */
bootcode = gpart_bootfile_read(s, &bootsize);
error = gctl_change_param(req, bootcode_param, bootsize,
bootcode);
diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c
index c80925a..c73d7f6 100644
--- a/sys/geom/part/g_part_apm.c
+++ b/sys/geom/part/g_part_apm.c
@@ -131,6 +131,26 @@ apm_parse_type(const char *type, char *buf, size_t bufsz)
strncpy(buf, type, bufsz);
return (0);
}
+ alias = g_part_alias_name(G_PART_ALIAS_APPLE_BOOT);
+ if (!strcasecmp(type, alias)) {
+ strcpy(buf, APM_ENT_TYPE_APPLE_BOOT);
+ return (0);
+ }
+ alias = g_part_alias_name(G_PART_ALIAS_APPLE_HFS);
+ if (!strcasecmp(type, alias)) {
+ strcpy(buf, APM_ENT_TYPE_APPLE_HFS);
+ return (0);
+ }
+ alias = g_part_alias_name(G_PART_ALIAS_APPLE_UFS);
+ if (!strcasecmp(type, alias)) {
+ strcpy(buf, APM_ENT_TYPE_APPLE_UFS);
+ return (0);
+ }
+ alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT);
+ if (!strcasecmp(type, alias)) {
+ strcpy(buf, APM_ENT_TYPE_APPLE_BOOT);
+ return (0);
+ }
alias = g_part_alias_name(G_PART_ALIAS_FREEBSD);
if (!strcasecmp(type, alias)) {
strcpy(buf, APM_ENT_TYPE_FREEBSD);
@@ -445,6 +465,12 @@ g_part_apm_type(struct g_part_table *basetable, struct g_part_entry *baseentry,
entry = (struct g_part_apm_entry *)baseentry;
type = entry->ent.ent_type;
+ if (!strcmp(type, APM_ENT_TYPE_APPLE_BOOT))
+ return (g_part_alias_name(G_PART_ALIAS_APPLE_BOOT));
+ if (!strcmp(type, APM_ENT_TYPE_APPLE_HFS))
+ return (g_part_alias_name(G_PART_ALIAS_APPLE_HFS));
+ if (!strcmp(type, APM_ENT_TYPE_APPLE_UFS))
+ return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD))
return (g_part_alias_name(G_PART_ALIAS_FREEBSD));
if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP))
OpenPOWER on IntegriCloud