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);
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;
}
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;
}
size_t nparts_max; /* maximal number of partitions */
size_t nparts_cur; /* number of currently used partitions */
+ int flags; /* FDISK_LABEL_FL_* flags */
+
unsigned int changed:1; /* label has been modified */
const struct fdisk_label_operations *op;
};
+/* label driver flags */
+enum {
+ FDISK_LABEL_FL_ADDPART_NOPARTNO = (1 << 1)
+};
+
/* label allocators */
extern struct fdisk_label *fdisk_new_gpt_label(struct fdisk_context *cxt);
extern struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt);