# 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