Fix clone_partitions not performing cloning in online upgrade 05/316105/3 accepted/tizen_unified_dev accepted/tizen/unified/20240819.150116 accepted/tizen/unified/dev/20240821.053453 accepted/tizen/unified/x/20240820.013144
authorAdam Michalski <a.michalski2@partner.samsung.com>
Tue, 13 Aug 2024 13:41:18 +0000 (15:41 +0200)
committerAdam Michalski <a.michalski2@partner.samsung.com>
Wed, 14 Aug 2024 08:54:14 +0000 (10:54 +0200)
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

scripts/rw-upgrade/offline-update-finalize.sh.in
scripts/rw-upgrade/online-update-success.sh.in
scripts/rw-upgrade/update.sh.in

index c730fd92ec1e9052833e3014e803705a34cf50cb..50f0229279f924897444a386442d779f75a8b7a6 100644 (file)
@@ -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
index 0a67d3167a74f62bfa61e539cb4967590c964586..b43730bb60219fc90f6011bb956a55bc85368b88 100644 (file)
@@ -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
index 92a4a36b065dbe0d2a8249c689f30bb1b8e116b2..b19c7b1b0f037a26fb1602545eabfa189f5906ef 100644 (file)
@@ -176,4 +176,6 @@ then
        rm ${STATUS_FILE}
        COMMIT_CHANGES
 fi
+
+SET_UPGRADE_PROGRESS_STATUS 100
 #Reboot by offline-update-post.service