summaryrefslogtreecommitdiff
path: root/fdisks/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2013-05-15 13:33:24 +0200
committerKarel Zak <kzak@redhat.com>2013-09-16 16:46:54 +0200
commitd87c7ce2bf9f49368b6406fa96c20a4dc7190b3b (patch)
tree35f7f73810a1fd432d2925211b61f382078fcfb6 /fdisks/fdisk.c
parent34b06299ce71aea4fd2b1437217ced0be013d91d (diff)
downloadutil-linux-d87c7ce2bf9f49368b6406fa96c20a4dc7190b3b.tar.gz
fdisk: add asktype "string" and support UUID partition change
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk.c')
-rw-r--r--fdisks/fdisk.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c
index 1964e4af..f209d587 100644
--- a/fdisks/fdisk.c
+++ b/fdisks/fdisk.c
@@ -69,7 +69,7 @@ static const struct menulist_descr menulist[] = {
{'c', N_("toggle the dos compatibility flag"), {FDISK_DISKLABEL_DOS, 0}},
{'c', N_("toggle the mountable flag"), {FDISK_DISKLABEL_SUN, 0}},
{'d', N_("delete a partition"), {FDISK_DISKLABEL_DOS | FDISK_DISKLABEL_SUN | FDISK_DISKLABEL_SGI | FDISK_DISKLABEL_OSF | FDISK_DISKLABEL_GPT, 0}},
- {'d', N_("print the raw data in the partition table"), {0, FDISK_DISKLABEL_ANY}},
+ {'d', N_("print the raw data of the first sector"), {0, FDISK_DISKLABEL_ANY}},
{'e', N_("change number of extra sectors per cylinder"), {0, FDISK_DISKLABEL_SUN}},
{'e', N_("edit drive data"), {FDISK_DISKLABEL_OSF, 0}},
{'e', N_("list extended partitions"), {0, FDISK_DISKLABEL_DOS}},
@@ -94,6 +94,7 @@ static const struct menulist_descr menulist[] = {
{'s', N_("show complete disklabel"), {FDISK_DISKLABEL_OSF, 0}},
{'t', N_("change a partition's system id"), {FDISK_DISKLABEL_DOS | FDISK_DISKLABEL_SUN | FDISK_DISKLABEL_SGI | FDISK_DISKLABEL_OSF, 0}},
{'u', N_("change display/entry units"), {FDISK_DISKLABEL_DOS | FDISK_DISKLABEL_SUN | FDISK_DISKLABEL_SGI | FDISK_DISKLABEL_OSF, 0}},
+ {'u', N_("change partition UUID"), {0, FDISK_DISKLABEL_GPT}},
{'v', N_("verify the partition table"), {FDISK_DISKLABEL_DOS | FDISK_DISKLABEL_SUN | FDISK_DISKLABEL_SGI, FDISK_DISKLABEL_DOS | FDISK_DISKLABEL_SUN | FDISK_DISKLABEL_SGI}},
{'w', N_("write disklabel to disk"), {FDISK_DISKLABEL_OSF, 0}},
{'w', N_("write table to disk and exit"), {FDISK_DISKLABEL_DOS | FDISK_DISKLABEL_SUN | FDISK_DISKLABEL_SGI | FDISK_DISKLABEL_GPT, FDISK_DISKLABEL_DOS | FDISK_DISKLABEL_SUN | FDISK_DISKLABEL_SGI}},
@@ -856,7 +857,7 @@ expert_command_prompt(struct fdisk_context *cxt)
case 'p':
if (fdisk_is_disklabel(cxt, SUN))
list_table(cxt, 1);
- else
+ else if (fdisk_is_disklabel(cxt, DOS))
dos_list_table_expert(cxt, 0);
break;
case 'q':
@@ -873,6 +874,11 @@ expert_command_prompt(struct fdisk_context *cxt)
"compatibility\n"));
fdisk_override_geometry(cxt, user_cylinders, user_heads, user_sectors);
break;
+ case 'u':
+ if (fdisk_is_disklabel(cxt, GPT) &&
+ fdisk_ask_partnum(cxt, &n, FALSE) == 0)
+ fdisk_gpt_partition_set_uuid(cxt, n);
+ break;
case 'v':
verify(cxt);
break;