summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2017-11-02 11:09:53 +0100
committerKarel Zak2017-11-02 11:17:24 +0100
commitc48acf70f746f23e8482b457837fba87a261f59e (patch)
tree37a8656ce7581bc5138e82e0aff80acd724b7087 /disk-utils
parentMerge branch 'bash-completion-fsck-find' of https://github.com/kevinoid/util-... (diff)
downloadkernel-qcow2-util-linux-c48acf70f746f23e8482b457837fba87a261f59e.tar.gz
kernel-qcow2-util-linux-c48acf70f746f23e8482b457837fba87a261f59e.tar.xz
kernel-qcow2-util-linux-c48acf70f746f23e8482b457837fba87a261f59e.zip
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>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/fdisk-menu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
index 532c57b26..8220d6586 100644
--- a/disk-utils/fdisk-menu.c
+++ b/disk-utils/fdisk-menu.c
@@ -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_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 */
static const struct menu menu_generic = {
@@ -162,12 +163,12 @@ static const struct menu menu_gpt = {
.callback = gpt_menu_cb,
.label = FDISK_DISKLABEL_GPT,
.entries = {
- MENU_XSEP(N_("GPT")),
+ MENU_BSEP(N_("GPT")),
MENU_XENT('i', N_("change disk GUID")),
MENU_XENT('n', N_("change partition name")),
MENU_XENT('u', N_("change partition UUID")),
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_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('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),
{ 0, NULL }
}
@@ -739,7 +740,8 @@ static int gpt_menu_cb(struct fdisk_context **cxt0,
if (!mbr)
return -ENOMEM;
*cxt0 = cxt = mbr;
- fdisk_enable_details(cxt, 1); /* keep us in expert mode */
+ if (fdisk_is_details(cxt))
+ fdisk_enable_details(cxt, 1); /* keep us in expert mode */
fdisk_info(cxt, _("Entering protective/hybrid MBR disklabel."));
return 0;
}