From a5d3a61643e01fabacbf12785398b5b39cef27ac Mon Sep 17 00:00:00 2001 From: SangYoun Kwak Date: Mon, 27 Jun 2022 14:09:49 +0900 Subject: [PATCH] Add critical_log to indicate upgrade progress Change-Id: Iee469d3fcbb3bc2dd614f20fbed1158f161ff5a9 Signed-off-by: SangYoun Kwak --- scripts/upgrade-common.inc | 5 +++++ scripts/upgrade-fota.sh | 2 ++ scripts/upgrade-legacy.sh | 2 ++ scripts/upgrade-partial.sh | 2 ++ scripts/upgrade-prepare-partitions.sh | 2 ++ scripts/upgrade-trigger.sh | 2 ++ 6 files changed, 15 insertions(+) diff --git a/scripts/upgrade-common.inc b/scripts/upgrade-common.inc index ef99812..9d485b4 100644 --- a/scripts/upgrade-common.inc +++ b/scripts/upgrade-common.inc @@ -279,6 +279,11 @@ write_version_info() { set_upgrade_status() { VALUE="$1" ${SET_UPGRADE_STATUS} ${VALUE} + if [ $? -eq 0 ]; then + critical_log "set upgrade status success: ${VALUE}" "$LOG_FILE" + else + critical_log "set upgrade status failed: ${VALUE}" "$LOG_FILE" + fi } exit_error() { diff --git a/scripts/upgrade-fota.sh b/scripts/upgrade-fota.sh index 4fc78a8..b0917e8 100755 --- a/scripts/upgrade-fota.sh +++ b/scripts/upgrade-fota.sh @@ -84,3 +84,5 @@ if ! reboot_to_fota; then exit 1 fi cleanup + +critical_log "RO update: $SCRIPT_NAME success" "$LOG_FILE" diff --git a/scripts/upgrade-legacy.sh b/scripts/upgrade-legacy.sh index 937a206..be16f1f 100644 --- a/scripts/upgrade-legacy.sh +++ b/scripts/upgrade-legacy.sh @@ -112,3 +112,5 @@ if ! /sbin/reboot fota; then critical_log "[Error] Failed to reboot fota" "$LOG_FILE" exit 100 fi + +critical_log "RO update: $SCRIPT_NAME success" "$LOG_FILE" diff --git a/scripts/upgrade-partial.sh b/scripts/upgrade-partial.sh index 0a35849..ea6aa7d 100755 --- a/scripts/upgrade-partial.sh +++ b/scripts/upgrade-partial.sh @@ -62,3 +62,5 @@ if ! run_setup_script "$DELTA_TAR"; then fi cleanup + +critical_log "RO update: $SCRIPT_NAME success" "$LOG_FILE" diff --git a/scripts/upgrade-prepare-partitions.sh b/scripts/upgrade-prepare-partitions.sh index a50cb06..ff15680 100755 --- a/scripts/upgrade-prepare-partitions.sh +++ b/scripts/upgrade-prepare-partitions.sh @@ -42,3 +42,5 @@ if ! background_copy; then exit_error fi cleanup_files + +critical_log "Background copy: $SCRIPT_NAME success" "$LOG_FILE" diff --git a/scripts/upgrade-trigger.sh b/scripts/upgrade-trigger.sh index 9784eac..f70981c 100644 --- a/scripts/upgrade-trigger.sh +++ b/scripts/upgrade-trigger.sh @@ -141,4 +141,6 @@ verify_file "$FOTA_DIR/upgrade-common.inc" set_upgrade_status 1 verify_img "${DOWNLOAD_DELTA}" do_update + +critical_log "RO update: $SCRIPT_NAME success" "$LOG_FILE" ) 9> "$FLOCK_PATH" -- 2.7.4