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.

TEST=cros_generate_update_payload --output=<outfile> --image=<infile> --patch_kernel

Change-Id: Ic081189f9431cb037a8b0eb02f0f9a19ad39d6d2
Reviewed-by: David James <>
Tested-by: Richard Barnette <>
1 file changed