Add timeout handling for RW-Upgrade scripts 45/318245/1 accepted/tizen_9.0_unified tizen_9.0 accepted/tizen/9.0/unified/20250117.022453
authorAdam Michalski <a.michalski2@partner.samsung.com>
Fri, 22 Nov 2024 15:38:17 +0000 (16:38 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 14 Jan 2025 16:30:37 +0000 (17:30 +0100)
commitb6b5f3344572bd84afed620505182f05ac5c7a2a
tree8d1a424b9313e437667ed38c0f42207efac5bf1e
parent032fdb20703ec832f0e45043e626261e323fbcac
Add timeout handling for RW-Upgrade scripts

Introduced timeout handling for RW-Upgrade scripts execution.

- Added `run-with-timeout.sh` for executing scripts with a specified
  default timeout.
- Modified `update.sh.in` to:
  - Use `run-with-timeout.sh` with the default timeout value.
  - Parse `###Timeout = <value>` in each script for custom timeouts.
  - Default to `INDIVIDUAL_SCRIPT_TIMEOUT` if no custom timeout is set.
  - Reads /etc/upgrade/conf.d/rw-upgrade-scripts.conf and sets the
    timeout value for all scripts based on it, otherwise sets it to
    25 seconds.
  - Ensure backward compatibility for scripts without custom timeouts.
  - Improve error handling for individual and total timeout violations.

This ensures stricter control over script execution timing and
improves the reliability of the RW-Upgrade process.

Change-Id: Id80f8912e7e4a96251e76cd87ea0131ed2700215
packaging/upgrade.spec
scripts/rw-upgrade/CMakeLists.txt
scripts/rw-upgrade/run-with-timeout.sh [new file with mode: 0644]
scripts/rw-upgrade/rw-upgrade-scripts.conf [new file with mode: 0644]
scripts/rw-upgrade/update.sh.in