From 2f6c2c92db0d5f670feec6598fec5b39af3409ee Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Fri, 26 Jul 2024 18:24:38 +0300 Subject: [PATCH 1/2] [reboot]: Allow reboot to happen regardless vendor hook errors. Signed-off-by: Nazarii Hnydyn --- scripts/reboot | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/reboot b/scripts/reboot index b6f8ff96fb..cb995eb16b 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,13 +276,6 @@ 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 - fi fi if [ -x ${WATCHDOG_UTIL} ]; then From 21e8169ef0617aa6ff98779734a23dba6a43030c Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Tue, 6 Aug 2024 19:23:05 +0300 Subject: [PATCH 2/2] [reboot]: Handle review comments. Signed-off-by: Nazarii Hnydyn --- scripts/reboot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/reboot b/scripts/reboot index cb995eb16b..3b4717a17c 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -276,6 +276,10 @@ 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 + debug "WARNING: Failed to handle pre-reboot script: rc=${EXIT_CODE}" + fi fi if [ -x ${WATCHDOG_UTIL} ]; then