upgrade-automation.sh: get update package directly
authorSunmin Lee <sunm.lee@samsung.com>
Fri, 8 Sep 2017 00:04:47 +0000 (09:04 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Wed, 20 Sep 2017 23:47:32 +0000 (08:47 +0900)
Simplify the interface of upgrade automation script
to use update pacakge (delta.tar) directly rather than find it.

Change-Id: Id997275659e427d88f41de77783f6bf544316ed8
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
scripts/upgrade-automation.sh

index bfc0e31..82b43d5 100755 (executable)
@@ -3,11 +3,6 @@
 #                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
 #---------------------------------------------------------#
 
 # Get argument
-if [ $# -lt 2 ]; then
-       echo "Usage: upgrade-automation.sh TOTA_UPG_PATH TARGET"
-       echo " TARGET> rpi3 | tw1"
+if [ $# -lt 1 ]; then
+       echo "Usage: upgrade-automation.sh UPDATE_PACKAGE"
        exit
 fi
 
-TOTA_UPG_PATH=$1
-TARGET=$2
-TOTA_UPG_TARGET=${TOTA_UPG_PATH}/mk_delta/${TARGET}
+UPKG=$1
 
 TOTA_DIR=/opt/usr/data/fota
 sdb root on
 sdb shell mkdir -p ${TOTA_DIR}
 
 #  4. Download delta to target
-DELTA_DIR=$(ls -1d ${TOTA_UPG_TARGET}/result/* | tail -1)
-sdb push ${DELTA_DIR}/FW_DELTA/delta.tar ${TOTA_DIR}
+sdb push ${UPKG} ${TOTA_DIR}/delta.tar
 
 #  5. Execute upgrade manager
 sdb shell tar xvfp ${TOTA_DIR}/delta.tar -C ${TOTA_DIR} upgrade-trigger.sh