5d5fa06e5c
We introduced the "settle" in I90103b59357edebbac7a641e8980cb282d37561b thinking that maybe kpartx had not finished writing the partition. This probably wasn't a bad first assumption, since we used to have this -- but is seems insufficient. The other failiure here seems to be if kpartx hasn't actually seen the updated partition table in the image, so it has correctly (in it's mind) not mounted the partition. Looking at strace of fdisk run manually on a loopback, it will do a fsync on the raw device after writing and then a global sync as it exits. This replicates this; we flush and fsync in mbr.py in the exit handler after writing the partition, before closing the file (i've updated one of the unit tests to double-check the call). In the partitioning.py caller we execute a sync call too. Since it does seem unlikely the "-s" option of kpartx is not working, I've removed the udev settle work-around too. Change-Id: Ia77a0ffe4c76854b326ed76490479d9c691b49aa Partial-Bug: #1698337 |
||
---|---|---|
.. | ||
__init__.py | ||
mbr.py | ||
partition.py | ||
partitioning.py |