RW_MACRO=@TZ_SYS_UPGRADE@/rw-update-macro.inc
+HAL_SET_UPGRADE_STATUS=/usr/bin/device_board_set_upgrade_status
+
+SCRIPT_NAME=$(basename $0)
+CRITICAL_LOG()
+{
+ LOG="[$SCRIPT_NAME]$1"
+ dlogsend -k "$LOG"
+ if [ "$2" != "" ]; then
+ echo "$LOG" >> "$2"
+ fi
+ echo "$LOG"
+}
+
+SET_UPGRADE_STATUS()
+{
+ ${HAL_SET_UPGRADE_STATUS} "$1"
+ if [ $? -eq 0 ]; then
+ CRITICAL_LOG "set_upgrade_status success: ${1}"
+ else
+ CRITICAL_LOG "set_upgrade_status failed: ${1}"
+ fi
+}
+
if [ -f $RW_MACRO ];
then
source $RW_MACRO
COMMIT_CHANGES
/usr/bin/device_board_clear_partition_ab_cloned
/usr/bin/device_board_set_boot_success
- /usr/bin/device_board_set_upgrade_status 100
+ SET_UPGRADE_STATUS 100
reboot -f
else
reboot -f fota