{base,dev,test}_image_util.sh: Use unmount_image.

create_base_image() uses mount_image() from mount_gpt_util.sh to mount
the GPT image it is creating. This function takes care of remembering
the parameters passed to mount_gpt_image.sh so when you call
unmount_image() from the same utility it passes the right mountpoints
and options used during mount. A similar situation occurs with dev
and test scripts.

While that is a great feature, create_base_image() uses its own local
function to unmount the image that also checks if the rootfs is nearly
full when there was an error building it.

This patch replaces the local cleanup_mount() function with
unmount_image() and ensures a consistent usage among all three
scripts.

BUG=chromium:455814
TEST=cbuildbot amd64-generic-full arm-generic-full

Change-Id: I70277c9ffe1943111bfe9a1e0b3577e61bd70058
Reviewed-on: https://chromium-review.googlesource.com/247332
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
3 files changed