Return a non-zero exit code if cleanup fails.

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

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.

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

BUG=chromium:353558
TEST=Local payload generation.

Change-Id: I014bd372f5c55e64383572df27b3cbba9b944337
Reviewed-on: https://chromium-review.googlesource.com/191702
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
1 file changed