Add automated upgrade script tool
authorSunmin Lee <sunm.lee@samsung.com>
Mon, 28 Aug 2017 02:55:13 +0000 (11:55 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Mon, 28 Aug 2017 11:09:07 +0000 (20:09 +0900)
This patch provides a script for automated upgrade.
- upgrade-automation.sh: script for automated upgrade test with device

Change-Id: I84add57261f2d10d13fdc35f9fccd5ed29899cec
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
scripts/delta-generation.sh
scripts/upgrade-automation.sh [new file with mode: 0755]

index f053bc3..2d556a9 100755 (executable)
@@ -13,7 +13,7 @@
 # Get argument
 if [ $# -lt 2 ]; then
        echo "Usage: delta-generation.sh TOTA_UPG_PATH TARGET"
-       echo " TARGET> rpi3 / tw1"
+       echo " TARGET> rpi3 | tw1"
        exit
 fi
 
diff --git a/scripts/upgrade-automation.sh b/scripts/upgrade-automation.sh
new file mode 100755 (executable)
index 0000000..11e56fe
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+#---------------------------------------------------------#
+#                Upgrade Automation Script
+#                   (Tizen 4.0 Upgrade)
+#
+# Preconditions
+#  * tota-upg
+#  * This script should accompany below script:
+#   write-version.sh
+#
+# Upgrade procedure
+#  1. Download images (old, new)
+#  2. Download old image to target
+#  3. Generate delta
+#  4. Download delta to target
+#  5. Execute upgrade trigger
+#
+# This script covers steps after delta (4, 5 step)
+#
+#---------------------------------------------------------#
+
+# Get argument
+if [ $# -lt 2 ]; then
+       echo "Usage: upgrade-automation.sh TOTA_UPG_PATH TARGET"
+       echo " TARGET> rpi3 | tw1"
+       exit
+fi
+
+TOTA_UPG_PATH=$1
+TARGET=$2
+TOTA_UPG_TARGET=${TOTA_UPG_PATH}/mk_delta/${TARGET}
+
+#  4. Download delta to target
+DELTA_DIR=$(ls -1d ${TOTA_UPG_TARGET}/result/* | tail -1)
+sdb -d push ${DELTA_DIR}/FW_DELTA/delta.tar ${TOTA_DIR}
+
+#  5. Execute upgrade trigger
+sdb -d shell /usr/bin/upgrade-trigger-${TARGET}.sh ${TOTA_DIR}/delta.tar