Skip to content

Commit

Permalink
[warm-reboot] remove ISSU bank check
Browse files Browse the repository at this point in the history
1. The file in which SDK holds ISSU bank information has changed and is
no longer issu_bank.txt
2. We shouldn't check the SDK dump content from SONiC as that
information and its format is constantly changing
3. ISSU bank information is written by pre_shutdown request anyway.
Verifying whether the information was indeed written right after that
seems redundant.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak committed Aug 12, 2023
1 parent 5b492d5 commit 151c445
Showing 1 changed file with 3 additions and 39 deletions.
42 changes: 3 additions & 39 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function request_pre_shutdown()
{
if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} ]; then
debug "Requesting platform reboot pre-check ..."
${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} ${REBOOT_TYPE}
${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} ${REBOOT_TYPE}
fi
debug "Requesting pre-shutdown ..."
STATE=$(timeout 5s docker exec syncd /usr/bin/syncd_request_shutdown --pre &> /dev/null; if [[ $? == 124 ]]; then echo "timed out"; fi)
Expand All @@ -202,34 +202,6 @@ function request_pre_shutdown()
fi
}
function recover_issu_bank_file()
{
debug "Recovering the (${ISSU_BANK_FILE}) file"
docker exec -i syncd sx_api_dbg_generate_dump.py
issu_bank_value=`docker exec -i syncd cat /tmp/sdkdump | grep 'ISSU Bank' | grep -o -E '[0-9]+'`
printf $issu_bank_value > /host/warmboot/issu_bank.txt
}
function check_issu_bank_file()
{
ISSU_BANK_FILE=/host/warmboot/issu_bank.txt
if [[ ! -s "$ISSU_BANK_FILE" ]]; then
error "(${ISSU_BANK_FILE}) does NOT exist or empty ..."
recover_issu_bank_file
return
fi
issu_file_chars_count=`stat -c %s ${ISSU_BANK_FILE}`;
issu_file_content=`awk '{print $0}' ${ISSU_BANK_FILE}`
if [[ $issu_file_chars_count != 1 ]] ||
[[ "$issu_file_content" != "0" && "$issu_file_content" != "1" ]]; then
error "(${ISSU_BANK_FILE}) is broken ..."
recover_issu_bank_file
fi
}
function wait_for_pre_shutdown_complete_or_fail()
{
debug "Waiting for pre-shutdown ..."
Expand Down Expand Up @@ -464,7 +436,7 @@ function invoke_kexec() {
function load_kernel() {
# Load kernel into the memory
invoke_kexec -a
invoke_kexec -a
}
function load_kernel_secure() {
Expand Down Expand Up @@ -630,7 +602,7 @@ fi
if is_secureboot && grep -q aboot_machine= /host/machine.conf; then
load_aboot_secureboot_kernel
else
# check if secure boot is enable in UEFI
# check if secure boot is enable in UEFI
CHECK_SECURE_UPGRADE_ENABLED=0
SECURE_UPGRADE_ENABLED=$(bootctl status 2>/dev/null | grep -c "Secure Boot: enabled") || CHECK_SECURE_UPGRADE_ENABLED=$?
if [[ CHECK_SECURE_UPGRADE_ENABLED -ne 0 ]]; then
Expand Down Expand Up @@ -773,17 +745,9 @@ for service in ${SERVICES_TO_STOP}; do
# Pre-shutdown syncd
initialize_pre_shutdown
if [[ "x$sonic_asic_type" == x"mellanox" ]]; then
check_issu_bank_file
fi
request_pre_shutdown
wait_for_pre_shutdown_complete_or_fail
if [[ "x$sonic_asic_type" == x"mellanox" ]]; then
check_issu_bank_file
fi
fi
if [[ "$REBOOT_TYPE" = "fastfast-reboot" || "$REBOOT_TYPE" = "fast-reboot" ]]; then
Expand Down

0 comments on commit 151c445

Please sign in to comment.