Refactor unmount_image with unmount_dir

To replace the similiar umount logic in unmout image.

Change-Id: Ia2105a48bbed00ba2571b442e216fccfbcc17f01
This commit is contained in:
JUN JIE NAN 2013-12-31 17:44:48 +08:00
parent 6b7cf26689
commit 893211f19a

View File

@ -22,11 +22,7 @@ function unmount_image () {
# unmount from the chroot
# Don't use TMP_MOUNT_PATH here, it might not have been set.
local MOUNTS
MOUNTS=$(grep < /proc/mounts " $TMP_BUILD_DIR/mnt" | awk '{ print $2 }' | sort -r)
for M in $MOUNTS; do
sudo umount -fl $M || true
done
unmount_dir "$TMP_BUILD_DIR/mnt"
if [ -n "$EXTRA_UNMOUNT" ]; then
$EXTRA_UNMOUNT
fi