diff options
author | marcel <marcel@FreeBSD.org> | 2013-06-09 23:34:26 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2013-06-09 23:34:26 +0000 |
commit | 0c3f6d383d180e43ea57dcf68a41ce554c2ce8d5 (patch) | |
tree | a742822f954b06551b2052f05b28bf4892ca8640 /sbin/geom/class | |
parent | 30f527d554a95ca25c21ad597ab9c0d1e304ce2a (diff) | |
download | FreeBSD-src-0c3f6d383d180e43ea57dcf68a41ce554c2ce8d5.zip FreeBSD-src-0c3f6d383d180e43ea57dcf68a41ce554c2ce8d5.tar.gz |
Change the set and unset ctlreqs by making the index argument optional.
This allows setting attributes on tables. One simply does not provide
an index in that case. Otherwise the entry corresponding the index has
the attribute set or unset.
Use this change to fix a relatively longstanding bug in our GPT scheme
that's the result of rev 198097 (relatively harmless) followed by rev
237057 (damaging). The damaging part being that our GPT scheme always
has the active flag set on the PMBR slice. This is in violation with
EFI. Existing EFI implementions for both x86 and ia64 reject the GPT.
As such, GPT disks created by us aren't usable under EFI because of
that.
After this change, GPT disks never have the active flag set on the PMBR
slice. In order to make the GPT disk bootable under some x86 BIOSes,
the reason of rev 198097, one must now set the active attribute on the
gpt table. The kernel will apply this to the PMBR slice For (S)ATA:
gpart set -a active ada0
To fix an existing GPT disk that has the active flag set in the PMBR,
and that does not need the flag, use (again for (S)ATA):
gpart unset -a active ada0
The EBR, MBR & PC98 schemes, which also impement at least 1 attribute,
now check to make sure the entry passed is valid. They do not have
attributes that apply to the table.
Diffstat (limited to 'sbin/geom/class')
-rw-r--r-- | sbin/geom/class/part/geom_part.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c index 8a57ca4..9b3e0e5 100644 --- a/sbin/geom/class/part/geom_part.c +++ b/sbin/geom/class/part/geom_part.c @@ -147,10 +147,10 @@ struct g_command PUBSYM(class_commands)[] = { }, { "set", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "-a attrib -i index [-f flags] geom" + "-a attrib [-i index] [-f flags] geom" }, { "show", 0, gpart_show, { { 'l', "show_label", NULL, G_TYPE_BOOL }, @@ -164,10 +164,10 @@ struct g_command PUBSYM(class_commands)[] = { }, { "unset", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "-a attrib -i index [-f flags] geom" + "-a attrib [-i index] [-f flags] geom" }, { "resize", 0, gpart_issue, { { 'a', "alignment", GPART_AUTOFILL, G_TYPE_STRING }, |