summaryrefslogtreecommitdiffstats
path: root/fdisk
diff options
context:
space:
mode:
authorFrancesco Cosoleto2011-05-06 17:23:31 +0200
committerKarel Zak2011-05-10 13:50:06 +0200
commitffde29b2bd770b3717d2f32be2485cb74ac88278 (patch)
treedd5ce6e3b5af73d35c8c3099f2f91d0916de61e7 /fdisk
parentfindmnt: add columns description to the --help output (diff)
downloadkernel-qcow2-util-linux-ffde29b2bd770b3717d2f32be2485cb74ac88278.tar.gz
kernel-qcow2-util-linux-ffde29b2bd770b3717d2f32be2485cb74ac88278.tar.xz
kernel-qcow2-util-linux-ffde29b2bd770b3717d2f32be2485cb74ac88278.zip
fdisk: change primary or extended partition type dialog
Mainly this appends a colon for the prompt, reverses order of the list, reports the number of primary partitions used and unused. Old version: Command action e extended p primary partition (1-4) p New version: Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select: p Old version: Command action l logical (5 or over) p primary partition (1-4) l New version: Partition type: p primary (0 primary, 1 extended, 3 free) l logical (numbered from 5) Select: l Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Diffstat (limited to 'fdisk')
-rw-r--r--fdisk/fdisk.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 4a37b3b9f..9356356c4 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
@@ -2534,9 +2534,13 @@ new_partition(void) {
} else {
char c, line[LINE_LENGTH];
snprintf(line, sizeof(line),
- _("Command action\n %s\n p primary "
- "partition (1-4)\n"), extended_offset ?
- _("l logical (5 or over)") : _("e extended"));
+ _("Partition type:\n"
+ " p primary (%d primary, %d extended, %d free)\n"
+ "%s\n"
+ "Select: "),
+ 4 - (extended_offset ? 1 : 0) - free_primary, extended_offset ? 1 : 0, free_primary,
+ extended_offset ? _(" l logical (numbered from 5)") : _(" e extended"));
+
while (1) {
if ((c = tolower(read_char(line))) == 'p') {
int i = get_nonexisting_partition(0, 4);