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

Fast-reboot: add a new flag to ignore ASIC checksum verification failure #1292

Merged
merged 1 commit into from
Dec 7, 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
9 changes: 7 additions & 2 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ REBOOT_SCRIPT_NAME=$(basename $0)
REBOOT_TYPE="${REBOOT_SCRIPT_NAME}"
VERBOSE=no
FORCE=no
IGNORE_ASIC=no
STRICT=no
REBOOT_METHOD="/sbin/kexec -e"
ASSISTANT_IP_LIST=""
Expand Down Expand Up @@ -55,6 +56,7 @@ function showHelpAndExit()
echo " -h,-? : get this help"
echo " -v : turn on verbose"
echo " -f : force execution"
echo " -i : ignore MD5-checksum-verification of ASIC configuration files"
echo " -r : reboot with /sbin/reboot"
echo " -k : reboot with /sbin/kexec -e [default]"
echo " -x : execute script with -x flag"
Expand All @@ -67,7 +69,7 @@ function showHelpAndExit()

function parseOptions()
{
while getopts "vfh?rkxc:s" opt; do
while getopts "vfih?rkxc:s" opt; do
case ${opt} in
h|\? )
showHelpAndExit
Expand All @@ -78,6 +80,9 @@ function parseOptions()
f )
FORCE=yes
;;
i )
IGNORE_ASIC=yes
;;
r )
REBOOT_METHOD="/sbin/reboot"
;;
Expand Down Expand Up @@ -335,7 +340,7 @@ function reboot_pre_check()
${ASIC_CONFIG_CHECK_SCRIPT} || ASIC_CONFIG_CHECK_EXIT_CODE=$?

if [[ "${ASIC_CONFIG_CHECK_EXIT_CODE}" != "${ASIC_CONFIG_CHECK_SUCCESS}" ]]; then
if [[ x"${FORCE}" == x"yes" ]]; then
if [[ x"${IGNORE_ASIC}" == x"yes" ]]; then
debug "Ignoring ASIC config checksum failure..."
else
error "ASIC config may have changed: errno=${ASIC_CONFIG_CHECK_EXIT_CODE}"
Expand Down