summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-09-12 10:56:27 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-09-27 16:58:33 (GMT)
commit16b94ae07ca575804d8098ca73b726e66390d758 (patch)
tree480c37445e5d63024cefc662c4a486504db46a80
parent91c93bce6d99ee5d536ad375e30388d777f572cf (diff)
downloadmajor-16b94ae07ca575804d8098ca73b726e66390d758.zip
major-16b94ae07ca575804d8098ca73b726e66390d758.tar.gz
major-16b94ae07ca575804d8098ca73b726e66390d758.tar.bz2
Add support for rpi3 2parts imagesrefs/changes/27/181827/1
Change-Id: I27f34b96a3759c7a545b97c882efa9284d6dc46c
-rwxr-xr-xtct/flash/flash_dd_rpi3-2parts.sh51
-rwxr-xr-xtct/rpi3_prepare_flash_conf.sh13
2 files changed, 61 insertions, 3 deletions
diff --git a/tct/flash/flash_dd_rpi3-2parts.sh b/tct/flash/flash_dd_rpi3-2parts.sh
new file mode 100755
index 0000000..992aa37
--- /dev/null
+++ b/tct/flash/flash_dd_rpi3-2parts.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# Copyright (c) 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.
+# 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
+# the layout is:
+# * boot.img -> 1st partition
+# * ramdisk.img -> 2nd partition
+# * systemd-data.img -> 3rd partition
+# * rootfs.img -> 5th partition
+# * modules.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 mkpart.sh available at:
+# https://wiki.tizen.org/wiki/Quick_guide_for_odroid#Fuse_bootloader_image
+#
+# 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=4096"
+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=ramdisk.img "of=${1}2"
+test -b "${1}3" || die "No ${1}3"
+$sdd if=system-data.img "of=${1}3"
+test -b "${1}5" || die "No ${1}5"
+$sdd if=rootfs.img "of=${1}5"
+test -b "${1}6" || die "No ${1}6"
+$sdd if=modules.img "of=${1}6"
+sync
diff --git a/tct/rpi3_prepare_flash_conf.sh b/tct/rpi3_prepare_flash_conf.sh
index 63083fc..ab17589 100755
--- a/tct/rpi3_prepare_flash_conf.sh
+++ b/tct/rpi3_prepare_flash_conf.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# 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.
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Script used to flash, prepare and configure ODROID U3
+# Script used to flash, prepare and configure RPI 3
#
# Syntax is: odroid_prepare_conf_flash.sh $SDMUX $BOOT_IMAGE $IMAGE \
# [$NATIVE_TCT_REPO]
@@ -51,7 +51,14 @@ 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}"
+case "$IMAGE" in
+ *2parts*)
+ "${TESTLAB_SCRIPTS}/flash/flash_dd_rpi3-2parts.sh" "${DEV_SDCARD}"
+ ;;
+ *)
+ "${TESTLAB_SCRIPTS}/flash/flash_dd_rpi3.sh" "${DEV_SDCARD}"
+ ;;
+esac
RET=$?
cd "${OLDPWD}"