dissect-image: wait for the root to appear
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 13 Dec 2018 13:35:15 +0000 (14:35 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Dec 2018 12:50:57 +0000 (13:50 +0100)
commitb887c8b8a836963c2949ae6a11b77430886d0b77
treefad28eb8e069d3d4c817997169249e6c30936ebb
parentea887be00b7a9374e29bc91fcd3e8fa6ea507eac
dissect-image: wait for the root to appear

dissect-image would wait for the root device and paritions to appear. But if we
had an image with no partitions, we'd not wait at all. If the kernel or udev
were slow in creating device nodes or symlinks, subsequent mount attempt might
fail if nspawn won the race.

Calling wait_for_partitions_to_appear() in case of no partitions means that we
verify that the kernel agrees that there are no partitions. We verify that the
kernel sees the same number of partitions as blkid, so let's that also in this
case.

This makes the failure in #10526 much less likely, but doesn't eliminate it
completely. Stay tuned.
src/shared/dissect-image.c