diff options
-rw-r--r-- | tools/builder_common.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/builder_common.sh b/tools/builder_common.sh index 2d6b404..9099d67 100644 --- a/tools/builder_common.sh +++ b/tools/builder_common.sh @@ -919,23 +919,24 @@ create_ova_image() { LOGFILE=${BUILDER_LOGS}/ova.${TARGET}.log - if [ -d "${OVA_TMP}" ]; then + local _mntdir=${OVA_TMP}/mnt + + if [ -d "${_mntdir}" ]; then local _dev # XXX Root cause still didn't found but it doesn't umount # properly on looped builds and then require this extra # check while true; do - _dev=$(mount -p ${OVA_TMP} 2>/dev/null | awk '{print $1}') + _dev=$(mount -p ${_mntdir} 2>/dev/null | awk '{print $1}') [ $? -ne 0 -o -z "${_dev}" ] \ && break - umount -f ${OVA_TMP} + umount -f ${_mntdir} mdconfig -d -u ${_dev#/dev/} done chflags -R noschg ${OVA_TMP} rm -rf ${OVA_TMP} fi - local _mntdir=${OVA_TMP}/mnt mkdir -p ${_mntdir} if [ -z "${OVA_SWAP_PART_SIZE_IN_GB}" -o "${OVA_SWAP_PART_SIZE_IN_GB}" = "0" ]; then |