diff options
author | Karel Zak | 2017-07-11 12:25:02 +0200 |
---|---|---|
committer | Karel Zak | 2017-07-11 12:25:02 +0200 |
commit | 2cb47542761f28caaea5a7e681646140f871b1c5 (patch) | |
tree | 1d5cebb8288f1200ff9b3c62879a3f7f19eab990 /libfdisk/src/partition.c | |
parent | libblkid: don't check for size on UBI (char dev) (diff) | |
download | kernel-qcow2-util-linux-2cb47542761f28caaea5a7e681646140f871b1c5.tar.gz kernel-qcow2-util-linux-2cb47542761f28caaea5a7e681646140f871b1c5.tar.xz kernel-qcow2-util-linux-2cb47542761f28caaea5a7e681646140f871b1c5.zip |
libfdisk: (dos) cleanup template based partitioning
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/partition.c')
-rw-r--r-- | libfdisk/src/partition.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index 3dd68b8ba..248e40b8b 100644 --- a/libfdisk/src/partition.c +++ b/libfdisk/src/partition.c @@ -1369,6 +1369,18 @@ int fdisk_partition_has_wipe(struct fdisk_context *cxt, struct fdisk_partition * * If @pa is not specified or any @pa item is missing the libfdisk will ask by * fdisk_ask_ API. * + * The @pa template is is important for non-interactive partitioning, + * especially for MBR where is necessary to differentiate between + * primary/logical; this is done by start offset or/and partno. + * The rules for MBR: + * + * A) template specifies start within extended partition: add logical + * B) template specifies start out of extended partition: add primary + * C) template specifies start (or default), partno < 4: add primary + * D) template specifies default start, partno >= 4: add logical + * + * otherwise MBR driver uses Ask-API to get missing information. + * * Adds a new partition to disklabel. * * Returns: 0 on success, <0 on error. |