The tool is totally outdated and only covers a single cloud. In addition
it depends on querydata which is deprecated since 21.10[0] and will be
removed soon.
Changes:
* Use short flags for BusyBox compatibility when needed.
* test-growpart(-lvm): run `udevadm settle` only if available.
* Drop `rm --one-file-system` flag in mount-image-callback's cleanup().
We check for the return code of do_umounts() instead, and avoid
removing files if something went wrong in the umount process.
This patch replaces long options for cmp, getopt, and truncate with
short options that are supported by both Busybox's implementation
and also the full implementations.
Add option to 'growpart' to specify percentage of device that should be
left unallocated when growing partition. This is intended for consumer
SSDs and SD cards where the performance and/or lifetime of these devices
can be improved if some disk space (in addition to any the device "hides"
from users) is left unallocated.
Overprovisioning code caters for several distinct scenarios:
(1) MSDOS/MBR partitioned disk where the disk is >2TB and so MBR
partitions cannot extend beyond 2TB - if disk is larger than
(2TB + overprovisioning requirement) then nothing needs to be
done.
(2) MSDOS/MBR partitioned disk where the disk is >2TB and so MBR
partitions cannot extend beyond 2TB - if disk is not larger
than (2TB + overprovisioning requirement) then *some*
overprovisioning space still needs to be reserved.
(3) MSDOS/MBR partitioned disk <=2TB where overprovisioning space
needs to be reserved.
(4) GPT partitioned disk where overprovisioning space needs to be
reserved.
Also added a testcase script, test-growpart-overprovision.
Also correct some off-by-one errors in the existing growpart code and
correct some existing testcases affected by this.