Fix missing mountpoint directory in mount_image() 93/79693/8
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Tue, 12 Jul 2016 09:50:57 +0000 (11:50 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Fri, 7 Oct 2016 15:29:30 +0000 (17:29 +0200)
Remove redundant mkdirs from tct/odroid_prepare_flash_conf.sh

Change-Id: I6da51ef4b7e82debf66eea88570b7e997bf7855a
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tct/odroid_prepare_flash_conf.sh
tct/prepare/prepare.sh

index 4452254..4995a6b 100755 (executable)
@@ -46,10 +46,8 @@ IMAGE_MOUNTPOINT="/tmp/image_mounted_${SDMUX}"
 
 switch2testserver "${SDMUX}"
 
-mkdir "${IMAGE_UNPACKED}"
 unpack_image "${BOOT_IMAGE}" "${IMAGE}" "${IMAGE_UNPACKED}"
 
-mkdir "${IMAGE_MOUNTPOINT}"
 mount_image "${IMAGE_UNPACKED}/rootfs.img" "${IMAGE_MOUNTPOINT}"
 install_iserial "${SDMUX}" "${IMAGE_MOUNTPOINT}"
 unmount_image "${IMAGE_MOUNTPOINT}"
index df79e1c..ccfc751 100755 (executable)
@@ -52,8 +52,10 @@ unpack_image() {
 mount_image() {
     IMAGE="$1"
     MOUNTPOINT="$2"
+
     test -n "${IMAGE}" || die "Missing argument: image"
     test -n "${MOUNTPOINT}" || die "Missing argument: mountpoint"
+    test -d "${MOUNTPOINT}" || mkdir -p "${MOUNTPOINT}"
 
     sudo mount -o loop "${IMAGE}" "${MOUNTPOINT}"
 }