Add tct/flash/flash_dd_artik.sh 35/106135/4
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 26 Oct 2016 14:28:29 +0000 (16:28 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 29 Mar 2017 10:48:09 +0000 (12:48 +0200)
Add params_artik10.bin and params_artik5.bin
Add replace_params() to tct/prepare/prepare.sh

Change-Id: If5fe1278432924c56cc83b6e0422d43f8fa7640a
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tct/flash/flash_dd_artik.sh [new file with mode: 0755]
tct/prepare/params_artik10.bin [new file with mode: 0644]
tct/prepare/params_artik5.bin [new file with mode: 0644]
tct/prepare/prepare.sh

diff --git a/tct/flash/flash_dd_artik.sh b/tct/flash/flash_dd_artik.sh
new file mode 100755 (executable)
index 0000000..515682b
--- /dev/null
@@ -0,0 +1,51 @@
+#!/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 for flashing SD card using dd for ARTIK
+# the layout is:
+#   * boot.img          -> 1st partition
+#   * modules.img       -> 2nd partition
+#   * rootfs.img        -> 3rd partition
+#   * systemd-data.img  -> 5th partition
+#   * user.img          -> 6th partition
+#
+# script always checks for block device availability
+# files are taken from CWD
+# there are no checks if files exist, dd should fail
+#
+# SD card should be prepared using script mk_sdboot available at:
+# https://github.com/tizen-artik/sdboot
+#
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+
+TESTLAB_SCRIPTS="$(CDPATH='' cd -- "$(dirname -- "$0")"/.. && pwd -P)"
+
+. "${TESTLAB_SCRIPTS}/common.sh"
+
+test -n "${1}" || die "Too few arguments!"
+
+sdd="sudo dd bs=1M"
+test -b "${1}1" || die "No ${1}1"
+$sdd if=boot.img "of=${1}1"
+test -b "${1}2" || die "No ${1}2"
+$sdd if=modules.img "of=${1}2"
+test -b "${1}3" || die "No ${1}3"
+$sdd if=rootfs.img "of=${1}3"
+test -b "${1}5" || die "No ${1}5"
+$sdd if=system-data.img "of=${1}5"
+test -b "${1}6" || die "No ${1}6"
+$sdd if=user.img "of=${1}6"
+sync
diff --git a/tct/prepare/params_artik10.bin b/tct/prepare/params_artik10.bin
new file mode 100644 (file)
index 0000000..df88e8c
Binary files /dev/null and b/tct/prepare/params_artik10.bin differ
diff --git a/tct/prepare/params_artik5.bin b/tct/prepare/params_artik5.bin
new file mode 100644 (file)
index 0000000..bb4a82c
Binary files /dev/null and b/tct/prepare/params_artik5.bin differ
index 120e007..24a8d8d 100755 (executable)
@@ -52,6 +52,15 @@ set_usb_mode() {
         "${IMAGE_MOUNTPOINT}/usr/lib/systemd/system/deviced.service"
 }
 
+replace_params() {
+    test -n "${TESTLAB_SCRIPTS}" || die "Missing env: testlab_scripts!"
+    IMAGE_MOUNTPOINT="$1"
+    ARTIK_MODEL="$2"
+    test -n "${IMAGE_MOUNTPOINT}" || die "Missing argument: image_mountpoint!"
+    test -n "${ARTIK_MODEL}" || die "Missing argument: artik_model!"
+    sudo cp "${TESTLAB_SCRIPTS}/prepare/params_${ARTIK_MODEL}" "${IMAGE_MOUNTPOINT}/params.bin"
+}
+
 unpack_image() {
     test $# -ge 2 || die "Too few arguments!"
     eval DESTINATION=\$$#