Skip to content

Commit 326e534

Browse files
authored
Fast-reboot: add a new flag to ignore ASIC config checksum verification 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.
1 parent 042254e commit 326e534

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/fast-reboot

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ REBOOT_SCRIPT_NAME=$(basename $0)
99
REBOOT_TYPE="${REBOOT_SCRIPT_NAME}"
1010
VERBOSE=no
1111
FORCE=no
12+
IGNORE_ASIC=no
1213
STRICT=no
1314
REBOOT_METHOD="/sbin/kexec -e"
1415
ASSISTANT_IP_LIST=""
@@ -55,6 +56,7 @@ function showHelpAndExit()
5556
echo " -h,-? : get this help"
5657
echo " -v : turn on verbose"
5758
echo " -f : force execution"
59+
echo " -i : ignore MD5-checksum-verification of ASIC configuration files"
5860
echo " -r : reboot with /sbin/reboot"
5961
echo " -k : reboot with /sbin/kexec -e [default]"
6062
echo " -x : execute script with -x flag"
@@ -67,7 +69,7 @@ function showHelpAndExit()
6769

6870
function parseOptions()
6971
{
70-
while getopts "vfh?rkxc:s" opt; do
72+
while getopts "vfih?rkxc:s" opt; do
7173
case ${opt} in
7274
h|\? )
7375
showHelpAndExit
@@ -78,6 +80,9 @@ function parseOptions()
7880
f )
7981
FORCE=yes
8082
;;
83+
i )
84+
IGNORE_ASIC=yes
85+
;;
8186
r )
8287
REBOOT_METHOD="/sbin/reboot"
8388
;;
@@ -335,7 +340,7 @@ function reboot_pre_check()
335340
${ASIC_CONFIG_CHECK_SCRIPT} || ASIC_CONFIG_CHECK_EXIT_CODE=$?
336341
337342
if [[ "${ASIC_CONFIG_CHECK_EXIT_CODE}" != "${ASIC_CONFIG_CHECK_SUCCESS}" ]]; then
338-
if [[ x"${FORCE}" == x"yes" ]]; then
343+
if [[ x"${IGNORE_ASIC}" == x"yes" ]]; then
339344
debug "Ignoring ASIC config checksum failure..."
340345
else
341346
error "ASIC config may have changed: errno=${ASIC_CONFIG_CHECK_EXIT_CODE}"

0 commit comments

Comments
 (0)