Use an exclusive file lock on the target disk prior to modifying the
partition table to prevent udev scripts from executing while the state
of the partition is being modified. Note that neither sfdisk nor sgdisk
currently take locks on disks and require the use of partx --update to
inform the kernel of changes to mounted partitions. Therefore the locks
must be held across both operations.
Drop the python2 only cloud-utils-euca package and tools.
euca2ools is python2 only, so tools that use it are no longer
maintainable. These tools were not specifically dependent on
euca2ools. The user could set EC2PRE='ec2-' and the tools would
then invoke the ec2-api-tool commands rather than their euca-
counterparts.
The same is true of ubuntu-ec2-run, but *it* would default to
ec2- as the prefix by default. However, it has not been maintained
for quite a while. So just remove it also.
test-growpart: fix logic error resulting in test failure.
In test-growpart, the cleanup code should unmount if the tracking
variable "MP" has a non-empty value, not an empty value. An empty
value would indicate that the mount has *not* been done.
Fix race condition in test-growpart teardown seen on ppc64el.
The test case 'test-growpart' seemed to have a race condition that
would sometimes be seen on the Ubuntu autopkg builder infrastructure.
The failure was only seen on ppc64el.
The fix here is to use 'udevadm settle' liberally in teardown.
I have admittedly not thought this completely through as to what
*could* cause this scenario, and 'udevadm settle' often has the same
effect as 'sleep 1'. That said, this is just in testcase teardown
so there is no harm in making it work even if this is not the fully
"proper" fix.
Also here is removal of code that was not used in test-growpart-fsimage.
There, MP and LODEV were never set, so the removed cleanup would
never run.
growpart: Fix bug when file image ends in a digit.
If the input to growpart was a file that ended in a digit (my.disk0)
then growing partition would fail because sfdisk output will
uses a 'p' to delimit the filename and partition name.
The fix here is safe/dumb at the cost of a bit of verbosity.