Fix a race condition when mounting loopback devices.

The previous code selected and configured the loopback device in two
separate stages.  This allowed for the possiblity that some other
code could claim the same loopback claimed by patch_kernel, leading
to failures.

BUG=chromium-os:24975
TEST=cros_generate_update_payload --output=<outfile> --image=<infile> --patch_kernel
TEST=image_to_live.sh

Change-Id: I5ea89f9e8519f1c02be22af3c172bfc7b52129ad
Reviewed-on: https://gerrit.chromium.org/gerrit/14646
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
1 file changed