fdisk: (gpt) make PMBR accessible from main menu
Don't force users to go to expert menu to toggle between GPT and PMBR. Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
03b3c55233
commit
c48acf70f7
|
@ -88,6 +88,7 @@ DECLARE_MENU_CB(generic_menu_cb);
|
||||||
|
|
||||||
#define MENU_ENT_NEST(k, t, l, p) { .title = t, .key = k, .normal = 1, .label = l, .parent = p }
|
#define MENU_ENT_NEST(k, t, l, p) { .title = t, .key = k, .normal = 1, .label = l, .parent = p }
|
||||||
#define MENU_XENT_NEST(k, t, l, p) { .title = t, .key = k, .expert = 1, .label = l, .parent = p }
|
#define MENU_XENT_NEST(k, t, l, p) { .title = t, .key = k, .expert = 1, .label = l, .parent = p }
|
||||||
|
#define MENU_BENT_NEST(k, t, l, p) { .title = t, .key = k, .expert = 1, .normal = 1, .label = l, .parent = p }
|
||||||
|
|
||||||
/* Generic menu */
|
/* Generic menu */
|
||||||
static const struct menu menu_generic = {
|
static const struct menu menu_generic = {
|
||||||
|
@ -162,12 +163,12 @@ static const struct menu menu_gpt = {
|
||||||
.callback = gpt_menu_cb,
|
.callback = gpt_menu_cb,
|
||||||
.label = FDISK_DISKLABEL_GPT,
|
.label = FDISK_DISKLABEL_GPT,
|
||||||
.entries = {
|
.entries = {
|
||||||
MENU_XSEP(N_("GPT")),
|
MENU_BSEP(N_("GPT")),
|
||||||
MENU_XENT('i', N_("change disk GUID")),
|
MENU_XENT('i', N_("change disk GUID")),
|
||||||
MENU_XENT('n', N_("change partition name")),
|
MENU_XENT('n', N_("change partition name")),
|
||||||
MENU_XENT('u', N_("change partition UUID")),
|
MENU_XENT('u', N_("change partition UUID")),
|
||||||
MENU_XENT('l', N_("change table length")),
|
MENU_XENT('l', N_("change table length")),
|
||||||
MENU_XENT('M', N_("enter protective/hybrid MBR")),
|
MENU_BENT('M', N_("enter protective/hybrid MBR")),
|
||||||
|
|
||||||
MENU_XSEP(""),
|
MENU_XSEP(""),
|
||||||
MENU_XENT('A', N_("toggle the legacy BIOS bootable flag")),
|
MENU_XENT('A', N_("toggle the legacy BIOS bootable flag")),
|
||||||
|
@ -221,7 +222,7 @@ static const struct menu menu_dos = {
|
||||||
MENU_XENT('b', N_("move beginning of data in a partition")),
|
MENU_XENT('b', N_("move beginning of data in a partition")),
|
||||||
MENU_XENT('i', N_("change the disk identifier")),
|
MENU_XENT('i', N_("change the disk identifier")),
|
||||||
|
|
||||||
MENU_XENT_NEST('M', N_("return from protective/hybrid MBR to GPT"),
|
MENU_BENT_NEST('M', N_("return from protective/hybrid MBR to GPT"),
|
||||||
FDISK_DISKLABEL_DOS, FDISK_DISKLABEL_GPT),
|
FDISK_DISKLABEL_DOS, FDISK_DISKLABEL_GPT),
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
}
|
}
|
||||||
|
@ -739,6 +740,7 @@ static int gpt_menu_cb(struct fdisk_context **cxt0,
|
||||||
if (!mbr)
|
if (!mbr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
*cxt0 = cxt = mbr;
|
*cxt0 = cxt = mbr;
|
||||||
|
if (fdisk_is_details(cxt))
|
||||||
fdisk_enable_details(cxt, 1); /* keep us in expert mode */
|
fdisk_enable_details(cxt, 1); /* keep us in expert mode */
|
||||||
fdisk_info(cxt, _("Entering protective/hybrid MBR disklabel."));
|
fdisk_info(cxt, _("Entering protective/hybrid MBR disklabel."));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue