Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:3454] [reboot]: Allow reboot to happen regardless vendor hook errors (#3454) #3517

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ REBOOT_SCRIPT_NAME=$(basename $0)
REBOOT_TYPE="${REBOOT_SCRIPT_NAME}"
TAG_LATEST=no
REBOOT_FLAGS=""
FORCE_REBOOT="no"

function debug()
{
Expand Down Expand Up @@ -192,7 +191,6 @@ function parse_options()
;;
f )
REBOOT_FLAGS+=" -f"
FORCE_REBOOT="yes"
;;
esac
done
Expand Down Expand Up @@ -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

Expand Down
Loading