libfdisk: allow to specify partition size by explicit number of sectors

Signed-off-by: Karel Zak <kzak@redhat.com>
fdisk: reset cached output fields when change disk label

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: add functions to play nasty games with first/last LBA

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: follow explicitly specified partition size

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (gpt) follow explicit size, fiz size+1 buf

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (dos) follow explicit sizes

* this patch add to dos driver support for fdisk_partition->size_explicit
  to avoid unexpected last sector alignment for sizes explicitly specified
  in sectors

* add support for small "first LBA", the current default is to use
  1MiB offset for the first partition and for each EBR. This is not
  backwardly compatible and it makes impossible to apply sfdisk
  scripts/dumps from old systems, because original offset can be
  smaller than 2048 sectors (old sfdisk default is 1 sector).

  The solution is on the fly to detect this situation and change
  fdisk_context->first_lba to 1 sector. Nasty.

Signed-off-by: Karel Zak <kzak@redhat.com>
sfdisk: ask on EOF

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: cleanup script dump

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: update sfdisk tests

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (dos) reset logical partition stuff after error

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: test cazy sizes for sfdisk

Signed-off-by: Karel Zak <kzak@redhat.com>