diff options
Diffstat (limited to 'fdisks')
-rw-r--r-- | fdisks/fdisk.c | 5 | ||||
-rw-r--r-- | fdisks/fdiskbsdlabel.c | 3 | ||||
-rw-r--r-- | fdisks/fdiskdoslabel.c | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c index d091a5d51..094b7e0f6 100644 --- a/fdisks/fdisk.c +++ b/fdisks/fdisk.c @@ -760,10 +760,7 @@ static void new_partition(struct fdisk_context *cxt) if (warn_geometry(cxt)) return; - if (fdisk_is_disklabel(cxt, SUN) || - fdisk_is_disklabel(cxt, SGI) || - fdisk_is_disklabel(cxt, GPT)) - + if (!(cxt->label->flags & FDISK_LABEL_FL_ADDPART_NOPARTNO)) partnum = get_partition_dflt(cxt, 0, cxt->label->nparts_max, cxt->label->nparts_cur + 1); diff --git a/fdisks/fdiskbsdlabel.c b/fdisks/fdiskbsdlabel.c index 5ef49cddb..060852bc3 100644 --- a/fdisks/fdiskbsdlabel.c +++ b/fdisks/fdiskbsdlabel.c @@ -972,5 +972,8 @@ struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt) lb->parttypes = xbsd_fstypes; lb->nparttypes = ARRAY_SIZE(xbsd_fstypes); + /* don't ask for partition number for op->part_add() */ + lb->flags = FDISK_LABEL_FL_ADDPART_NOPARTNO; + return lb; } diff --git a/fdisks/fdiskdoslabel.c b/fdisks/fdiskdoslabel.c index e622ac517..a65466bac 100644 --- a/fdisks/fdiskdoslabel.c +++ b/fdisks/fdiskdoslabel.c @@ -1501,6 +1501,9 @@ struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt) lb->parttypes = dos_parttypes; lb->nparttypes = ARRAY_SIZE(dos_parttypes); + /* don't ask for partition number for op->part_add() */ + lb->flags = FDISK_LABEL_FL_ADDPART_NOPARTNO; + return lb; } |