Dont try to unmount if were not using tmpfs

I regularly see users report that their build fails because this unmount
line reports an error. Even though we dont bail here because of the ||
true, as a user it is hard to distinguish this from an error.

Change-Id: Ic43f4fb24c53c58329fdf501bba6ba14024ec2aa
This commit is contained in:
Gregory Haynes 2015-03-24 18:30:55 +00:00
parent 100959de8d
commit f06e3fdb01

View File

@ -172,7 +172,9 @@ function mount_qcow_image() {
function cleanup_dirs () {
sudo rm -rf $TMP_BUILD_DIR/built
sudo rm -rf $TMP_BUILD_DIR/mnt
sudo umount -f $TMP_BUILD_DIR $TMP_IMAGE_DIR || true
if tmpfs_check ; then
sudo umount -f $TMP_BUILD_DIR $TMP_IMAGE_DIR || true
fi
rm -rf --one-file-system $TMP_BUILD_DIR $TMP_IMAGE_DIR
}