Teach gpart about bootcode on APM.
This commit is contained in:
parent
b7a63fb85c
commit
9090794d6c
@ -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);
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user