From f06e3fdb01943c0a0f08660f1785d732eba180b5 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Tue, 24 Mar 2015 18:30:55 +0000 Subject: [PATCH] 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 --- lib/common-functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/common-functions b/lib/common-functions index e7cccd30..a21684ee 100644 --- a/lib/common-functions +++ b/lib/common-functions @@ -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 }