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
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=$?
-# 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.
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"
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=$?
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