summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-09-26 15:13:20 +0200
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-10-16 13:21:47 +0200
commit43ba22700ca681ba924b88464e1fad7926f858af (patch)
tree94312e666a90a89cf41677905ed830c9b1a6cb77
parenta202373414535118c8679d6b2135a0778faa8ef6 (diff)
downloadmajor-43ba22700ca681ba924b88464e1fad7926f858af.tar.gz
major-43ba22700ca681ba924b88464e1fad7926f858af.tar.bz2
major-43ba22700ca681ba924b88464e1fad7926f858af.zip
Check if all required partitions are present
Very often some partition were missing or were replaced with regular files. It caused system to write to disk instead of sdcard. Change-Id: Ie2c6b975d01cb2628b04d593294ac5314e80a2ca
-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