From 1abedadc921a62fdc330c33504ec33e5d085c704 Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Wed, 15 Nov 2017 16:29:14 +0100 Subject: [PATCH] Remove directory with unpacked images if present Change-Id: I07bbefff1b373ff4e187cef9d82b844808d61695 --- tct/artik_prepare_flash_conf.sh | 1 + tct/odroid_prepare_flash_conf.sh | 1 + tct/rpi3_prepare_flash_conf.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/tct/artik_prepare_flash_conf.sh b/tct/artik_prepare_flash_conf.sh index 2d74a8c..cc58eab 100755 --- a/tct/artik_prepare_flash_conf.sh +++ b/tct/artik_prepare_flash_conf.sh @@ -57,6 +57,7 @@ T_DIR="/tmpfs/${SDMUX}" mkdir -p "${T_DIR}" IMAGE_UNPACKED="${T_DIR}/unpacked" +test -d "$IMAGE_UNPACKED" && rm -rf "$IMAGE_UNPACKED" IMAGE_MOUNTPOINT="${T_DIR}/mounted" TMP_TAR="/tmpfs/tizen-${SDMUX}.tar" diff --git a/tct/odroid_prepare_flash_conf.sh b/tct/odroid_prepare_flash_conf.sh index 2da5933..eb8cb11 100755 --- a/tct/odroid_prepare_flash_conf.sh +++ b/tct/odroid_prepare_flash_conf.sh @@ -40,6 +40,7 @@ test -n "${IMAGE}" || die "Missing argument: image!" echo "### prepare ###" IMAGE_UNPACKED="/tmpfs/image_unpacked_${SDMUX}" +test -d "$IMAGE_UNPACKED" && rm -rf "$IMAGE_UNPACKED" IMAGE_MOUNTPOINT="/tmpfs/image_mounted_${SDMUX}" switch2testserver "${SDMUX}" diff --git a/tct/rpi3_prepare_flash_conf.sh b/tct/rpi3_prepare_flash_conf.sh index 5895229..09f14d5 100755 --- a/tct/rpi3_prepare_flash_conf.sh +++ b/tct/rpi3_prepare_flash_conf.sh @@ -39,6 +39,7 @@ test -n "${IMAGE}" || die "Missing argument: image!" echo "### prepare ###" IMAGE_UNPACKED="/tmpfs/image_unpacked_${SDMUX}" +test -d "$IMAGE_UNPACKED" && rm -rf "$IMAGE_UNPACKED" IMAGE_MOUNTPOINT="/tmpfs/image_mounted_${SDMUX}" switch2testserver "${SDMUX}" -- 2.7.4