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

[reboot] make sure the reboot happens even if platform reboot failed #819

Merged
merged 3 commits into from
Feb 23, 2020
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
20 changes: 14 additions & 6 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,19 @@ fi
if [ -x ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ]; then
VERBOSE=yes debug "Rebooting with platform ${PLATFORM} specific tool ..."
exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@
else
# If no platform-specific reboot tool, just run /sbin/reboot
exec /sbin/reboot $@

# There are a couple reasons execution reaches here:
#
# 1. The vendor platform reboot returned after scheduled the platform specific reboot.
# This is a vendor platform reboot code bug but it happens.
# 2. The vendor platform reboot failed. e.g. due to platform driver didn't load properly.
#
# As result if the reboot script reaches here. We should make the reboot happen.
# Sleep 1 second before calling /sbin/reboot to accommodate situation #1 above.
sleep 1

VERBOSE=yes debug "Platform specific reboot failed!" >&2
fi

# Should never reach here
VERBOSE=yes debug "Reboot failed!" >&2
exit 1
VERBOSE=yes debug "Issuing OS-level reboot ..." >&2
exec /sbin/reboot $@
jleveque marked this conversation as resolved.
Show resolved Hide resolved