summaryrefslogtreecommitdiff
path: root/tct/rpi3_prepare_flash_conf.sh
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-04-19 10:59:53 +0200
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-06-06 13:44:33 +0200
commite9896da83265ec3a31db1da84ba97d3754f7c0c5 (patch)
tree3c96f6860e6f3818407fe28c536b184816299ff5 /tct/rpi3_prepare_flash_conf.sh
parent5e478407f5c974d0b4a30ff76ee347192778a53f (diff)
downloadmajor-e9896da83265ec3a31db1da84ba97d3754f7c0c5.tar.gz
major-e9896da83265ec3a31db1da84ba97d3754f7c0c5.tar.bz2
major-e9896da83265ec3a31db1da84ba97d3754f7c0c5.zip
Add rPi3 to TITS
Database update is required. Delete it or run: . tsp/common.sh sqlite3 "${DBPATH}" -batch < tsp/results-values-device.sql Change-Id: I220f060a7186b047a2d55271beab1aafc4398863
Diffstat (limited to 'tct/rpi3_prepare_flash_conf.sh')
-rwxr-xr-xtct/rpi3_prepare_flash_conf.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/tct/rpi3_prepare_flash_conf.sh b/tct/rpi3_prepare_flash_conf.sh
new file mode 100755
index 0000000..63083fc
--- /dev/null
+++ b/tct/rpi3_prepare_flash_conf.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# Copyright (c) 2016 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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Script used to flash, prepare and configure ODROID U3
+#
+# Syntax is: odroid_prepare_conf_flash.sh $SDMUX $BOOT_IMAGE $IMAGE \
+# [$NATIVE_TCT_REPO]
+#
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+
+export TESTLAB_SCRIPTS="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"
+
+. "${TESTLAB_SCRIPTS}/common.sh"
+
+SDMUX="$1"
+BOOT_IMAGE="$2"
+IMAGE="$3"
+
+test -n "${SDMUX}" || die "Missing argument: sdmux!"
+test -n "${BOOT_IMAGE}" || die "Missing argument: boot image!"
+test -n "${IMAGE}" || die "Missing argument: image!"
+
+. "${TESTLAB_SCRIPTS}/prepare/prepare.sh"
+. "${TESTLAB_SCRIPTS}/flash/flash.sh"
+
+echo "### prepare ###"
+
+IMAGE_UNPACKED="/tmp/image_unpacked_${SDMUX}"
+IMAGE_MOUNTPOINT="/tmp/image_mounted_${SDMUX}"
+
+switch2testserver "${SDMUX}"
+
+unpack_image "${BOOT_IMAGE}" "${IMAGE}" "${IMAGE_UNPACKED}"
+
+echo "### flash ###"
+
+UUID_FILE="/var/tmp/uuid-${SDMUX}"
+DEV_SDCARD=$(uuid2dev "${UUID_FILE}" "${SDMUX}") || die "sdcard not found!"
+
+cd "${IMAGE_UNPACKED}"
+"${TESTLAB_SCRIPTS}/flash/flash_dd_rpi3.sh" "${DEV_SDCARD}"
+RET=$?
+cd "${OLDPWD}"
+
+change_uuid "${UUID_FILE}" "${DEV_SDCARD}"
+if [ $RET -ne 0 ]; then
+ die "flash_dd exited with an error" "$RET"
+fi
+switch2device "${SDMUX}"
+restart_device "${SDMUX}"