summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtct/artik_prepare_flash_conf.sh2
-rwxr-xr-xtct/flash/flash.sh15
-rwxr-xr-xtct/odroid_prepare_flash_conf.sh2
-rwxr-xr-xtct/rpi3_prepare_flash_conf.sh2
4 files changed, 20 insertions, 1 deletions
diff --git a/tct/artik_prepare_flash_conf.sh b/tct/artik_prepare_flash_conf.sh
index 7b8483c..2d74a8c 100755
--- a/tct/artik_prepare_flash_conf.sh
+++ b/tct/artik_prepare_flash_conf.sh
@@ -80,6 +80,8 @@ echo "### flash ###"
UUID_FILE="/var/tmp/uuid-${SDMUX}"
DEV_SDCARD=$(uuid2dev "${UUID_FILE}" "${SDMUX}") || die "sdcard not found!"
+check_parts "$DEV_SDCARD" 1 2 3 5 6
+
"${ARTIK_FLASH_SCRIPT}" -d "${DEV_SDCARD}" -m "${MODEL}" -p "${TMP_TAR}"
RET=$?
diff --git a/tct/flash/flash.sh b/tct/flash/flash.sh
index 542763b..85323a1 100755
--- a/tct/flash/flash.sh
+++ b/tct/flash/flash.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+# Copyright (c) 2016-2017 Samsung Electronics Co., Ltd All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -60,6 +60,19 @@ uuid2dev() {
echo "/dev/${DEV%[0-9]}"
}
+check_parts() {
+ test $# -ge 2 || die "Too few arguments!"
+ DEVICE="$1"
+ test -b "${DEVICE}" || die "No such device!"
+ shift
+
+ while [ $# -ge 1 ]; do
+ PART="$1"
+ test -b "${DEVICE}${PART}" || die "Missing partition: $PART of $DEVICE"
+ shift
+ done
+}
+
change_uuid() {
FILE="$1"
DEV_SDCARD="$2"
diff --git a/tct/odroid_prepare_flash_conf.sh b/tct/odroid_prepare_flash_conf.sh
index 03bfd23..2da5933 100755
--- a/tct/odroid_prepare_flash_conf.sh
+++ b/tct/odroid_prepare_flash_conf.sh
@@ -62,6 +62,8 @@ echo "### flash ###"
UUID_FILE="/var/tmp/uuid-${SDMUX}"
DEV_SDCARD=$(uuid2dev "${UUID_FILE}" "${SDMUX}") || die "sdcard not found!"
+check_parts "$DEV_SDCARD" 1 2 3 5 6
+
cd "${IMAGE_UNPACKED}"
"${TESTLAB_SCRIPTS}/flash/flash_dd.sh" "${DEV_SDCARD}"
RET=$?
diff --git a/tct/rpi3_prepare_flash_conf.sh b/tct/rpi3_prepare_flash_conf.sh
index 92916d0..44520af 100755
--- a/tct/rpi3_prepare_flash_conf.sh
+++ b/tct/rpi3_prepare_flash_conf.sh
@@ -53,9 +53,11 @@ DEV_SDCARD=$(uuid2dev "${UUID_FILE}" "${SDMUX}") || die "sdcard not found!"
cd "${IMAGE_UNPACKED}"
case "$IMAGE" in
*2parts*)
+ check_parts "$DEV_SDCARD" 1 2 3 6
"${TESTLAB_SCRIPTS}/flash/flash_dd_rpi3-2parts.sh" "${DEV_SDCARD}"
;;
*)
+ check_parts "$DEV_SDCARD" 1 2 3 5 6
"${TESTLAB_SCRIPTS}/flash/flash_dd_rpi3.sh" "${DEV_SDCARD}"
;;
esac