summaryrefslogtreecommitdiffstats
path: root/fdisks/fdisk-menu.c
diff options
context:
space:
mode:
authorKarel Zak2013-10-16 15:30:43 +0200
committerKarel Zak2013-10-23 10:46:10 +0200
commitf362d863c477c80c8c791c1f3547953344563c2f (patch)
treee77891cb1ea5952aef2ac58da452ae11c653f9f7 /fdisks/fdisk-menu.c
parentlibfdisk: support extended attributes modification (diff)
downloadkernel-qcow2-util-linux-f362d863c477c80c8c791c1f3547953344563c2f.tar.gz
kernel-qcow2-util-linux-f362d863c477c80c8c791c1f3547953344563c2f.tar.xz
kernel-qcow2-util-linux-f362d863c477c80c8c791c1f3547953344563c2f.zip
fdisk: (gpt) add A,B,R,S expert commands to modify attributes
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk-menu.c')
-rw-r--r--fdisks/fdisk-menu.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/fdisks/fdisk-menu.c b/fdisks/fdisk-menu.c
index daa47d1e3..ced819aaf 100644
--- a/fdisks/fdisk-menu.c
+++ b/fdisks/fdisk-menu.c
@@ -159,6 +159,13 @@ struct menu menu_gpt = {
MENU_XENT('n', N_("change partition name")),
MENU_XENT('u', N_("change partition UUID")),
MENU_XENT('M', N_("enter protective/hybrid MBR")),
+
+ MENU_XSEP(""),
+ MENU_XENT('A', N_("toggle the legacy BIOS bootable flag")),
+ MENU_XENT('B', N_("toggle the no block IO protocol flag")),
+ MENU_XENT('R', N_("toggle the required partition flag")),
+ MENU_XENT('S', N_("toggle the GUID specific bits")),
+
{ 0, NULL }
}
};
@@ -350,7 +357,9 @@ static int print_fdisk_menu(struct fdisk_context *cxt)
while ((e = next_menu_entry(cxt, &mc))) {
if (IS_MENU_HID(e))
continue; /* hidden entry */
- if (IS_MENU_SEP(e)) {
+ if (IS_MENU_SEP(e) && (!e->title || !*e->title))
+ printf("\n");
+ else if (IS_MENU_SEP(e)) {
color_enable(UL_COLOR_BOLD);
printf("\n %s\n", _(e->title));
color_disable();
@@ -571,6 +580,18 @@ static int gpt_menu_cb(struct fdisk_context **cxt0,
case 'n':
rc = fdisk_gpt_partition_set_name(cxt, n);
break;
+ case 'A':
+ rc = fdisk_partition_toggle_flag(cxt, n, GPT_FLAG_LEGACYBOOT);
+ break;
+ case 'B':
+ rc = fdisk_partition_toggle_flag(cxt, n, GPT_FLAG_NOBLOCK);
+ break;
+ case 'R':
+ rc = fdisk_partition_toggle_flag(cxt, n, GPT_FLAG_REQUIRED);
+ break;
+ case 'S':
+ rc = fdisk_partition_toggle_flag(cxt, n, GPT_FLAG_GUIDSPECIFIC);
+ break;
}
}
return rc;