summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-15 08:55:38 -0200
committerRenato Botelho <renato@netgate.com>2017-02-15 08:55:50 -0200
commite3b1ebd214b89b11574254f6af18734cc05fae77 (patch)
treee0451d76497be416de68e4ab3e7fbf1a34c44954
parentc7408e4456fa5de6be7341bf65ae6b5e3185d60e (diff)
downloadpfsense-e3b1ebd214b89b11574254f6af18734cc05fae77.zip
pfsense-e3b1ebd214b89b11574254f6af18734cc05fae77.tar.gz
Make sure OVA_TMP is umounted before start using it
-rw-r--r--tools/builder_common.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/builder_common.sh b/tools/builder_common.sh
index 091266a..b4e1511 100644
--- a/tools/builder_common.sh
+++ b/tools/builder_common.sh
@@ -920,6 +920,17 @@ create_ova_image() {
LOGFILE=${BUILDER_LOGS}/ova.${TARGET}.log
if [ -d "${OVA_TMP}" ]; 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}')
+ [ $? -ne 0 -o -z "${_dev}" ] \
+ && break
+ umount -f ${OVA_TMP}
+ mdconfig -d -u ${_dev#/dev/}
+ done
chflags -R noschg ${OVA_TMP}
rm -rf ${OVA_TMP}
fi
OpenPOWER on IntegriCloud