From d25e531f1b587ffd4c280a8ca2b7ad6a15f339ab Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Tue, 3 Sep 2024 04:17:11 +0300 Subject: [PATCH] [reboot]: Allow reboot to happen regardless vendor hook errors (#3454) * [reboot]: Allow reboot to happen regardless vendor hook errors. Signed-off-by: Nazarii Hnydyn * [reboot]: Handle review comments. Signed-off-by: Nazarii Hnydyn --------- Signed-off-by: Nazarii Hnydyn --- scripts/reboot | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/reboot b/scripts/reboot index b6f8ff96fb..3b4717a17c 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -41,7 +41,6 @@ REBOOT_SCRIPT_NAME=$(basename $0) REBOOT_TYPE="${REBOOT_SCRIPT_NAME}" TAG_LATEST=no REBOOT_FLAGS="" -FORCE_REBOOT="no" function debug() { @@ -192,7 +191,6 @@ function parse_options() ;; f ) REBOOT_FLAGS+=" -f" - FORCE_REBOOT="yes" ;; esac done @@ -278,12 +276,9 @@ fi if [ -x ${DEVPATH}/${PLATFORM}/${PRE_REBOOT_HOOK} ]; then debug "Executing the pre-reboot script" ${DEVPATH}/${PLATFORM}/${PRE_REBOOT_HOOK} - EXIT_CODE=$? - if [[ ${EXIT_CODE} != ${EXIT_SUCCESS} ]]; then - if [[ "${FORCE_REBOOT}" != "yes" ]]; then - echo "Reboot is interrupted: use -f (force) to override" - exit ${EXIT_ERROR} - fi + EXIT_CODE="$?" + if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then + debug "WARNING: Failed to handle pre-reboot script: rc=${EXIT_CODE}" fi fi