Use lazy umount to unmount loopback devices.

This is an attempt to work around, which is believed to
be caused by non-atomic umount, which is believed to be a kernel bug.

Switch to using lazy umounts, in the hope that it's a clean(ish) workaround.

Keep retry loops that will keep trying to cleanup the mount point directory
once a minute for up to 10 minutes.

Also, dump mount related debug info after every umount or rmdir failure to
help try and diagnose this.

In addition, if any command returns an error during the cleanup, make the
script return a non-zero exit code. This triggers additional logging in
most call sites for the script.

TEST=Local payload generation.

Change-Id: I8ddaf8ddf2f072a404c1aa0ad9cdab84e2a73cbf
Tested-by: Don Garrett <>
Reviewed-by: David James <>
Commit-Queue: Don Garrett <>
1 file changed