Skip to content

Commit

Permalink
Fast-reboot: add a new flag to ignore ASIC config checksum verificati…
Browse files Browse the repository at this point in the history
…on failures (sonic-net#1292)

To fix the issue sonic-net#5972
warm-reboot with force flag ignores ASIC config checksum mismatch along with orchagent RESTARTCHECK failure.
This commit accounts for a use case when checksum-verification should be ignored but orchagent pause check should not be ignored.
The change is to add a new option in fast-reboot script to ignore ASIC checksum verification failures.
  • Loading branch information
vaibhavhd authored Dec 7, 2020
1 parent 042254e commit 326e534
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit 326e534

Please sign in to comment.