From: Adam Michalski Date: Tue, 13 Aug 2024 13:41:18 +0000 (+0200) Subject: Fix clone_partitions not performing cloning in online upgrade X-Git-Tag: accepted/tizen/unified/20240819.150116^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a84b9dc5cff6b5204351cc26dab2945880fd015;p=platform%2Fcore%2Fsystem%2Fupgrade.git Fix clone_partitions not performing cloning in online upgrade In order for the upgrade state to be completed, upgrade_progress_status must be equal to 100. Previously this value was set by the online-update-success service, but this service is executed after the upgrade-manager service. As a result, the upgrade state is never switched from "ready" to "completed" preventing clone_partitions from taking its job. The solution is to take over the responsibility for setting the upgrade progress status by the update.sh script instead of the online-update-success.sh (which is executed from online-update-success service). This way handling of the progress becomes unified regardless of the upgrade type. Change-Id: I1d599251986dac7a378a44545e8dcce285ccab89 --- diff --git a/scripts/rw-upgrade/offline-update-finalize.sh.in b/scripts/rw-upgrade/offline-update-finalize.sh.in index c730fd9..50f0229 100644 --- a/scripts/rw-upgrade/offline-update-finalize.sh.in +++ b/scripts/rw-upgrade/offline-update-finalize.sh.in @@ -39,12 +39,12 @@ if [ -z ${UPDATE_PREPARE_ERR+x} ] && "$UPDATE_VERIFY_SCRIPT"; then /usr/bin/device_board_clear_boot_mode if ! COMMIT_CHANGES; then ERROR "FAIL: Commit changes error" + SET_UPGRADE_PROGRESS_STATUS -1 reboot -f fota fi /usr/bin/device_board_clear_partition_ab_cloned /usr/bin/device_board_set_boot_success - SET_UPGRADE_PROGRESS_STATUS 100 reboot -f else reboot -f fota diff --git a/scripts/rw-upgrade/online-update-success.sh.in b/scripts/rw-upgrade/online-update-success.sh.in index 0a67d31..b43730b 100644 --- a/scripts/rw-upgrade/online-update-success.sh.in +++ b/scripts/rw-upgrade/online-update-success.sh.in @@ -37,12 +37,12 @@ if [ -z ${UPDATE_PREPARE_ERR+x} ]; then /usr/bin/device_board_clear_boot_mode if ! COMMIT_CHANGES; then ERROR "FAIL: Commit changes error" + SET_UPGRADE_PROGRESS_STATUS -1 reboot -f fota fi /usr/bin/device_board_clear_partition_ab_cloned /usr/bin/device_board_set_boot_success - SET_UPGRADE_PROGRESS_STATUS 100 else reboot -f fota fi diff --git a/scripts/rw-upgrade/update.sh.in b/scripts/rw-upgrade/update.sh.in index 92a4a36..b19c7b1 100644 --- a/scripts/rw-upgrade/update.sh.in +++ b/scripts/rw-upgrade/update.sh.in @@ -176,4 +176,6 @@ then rm ${STATUS_FILE} COMMIT_CHANGES fi + +SET_UPGRADE_PROGRESS_STATUS 100 #Reboot by offline-update-post.service