From c81269847c96c98b6b8d7fc181b25416d3312a06 Mon Sep 17 00:00:00 2001 From: jhli-cisco <93410383+jhli-cisco@users.noreply.github.com> Date: Wed, 1 Mar 2023 14:59:01 -0800 Subject: [PATCH 1/2] Update fast-reboot give platform chance to do proper cleanup before shutting down swss in warm/fast-reboot --- scripts/fast-reboot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index d81f9d8188..512131549e 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -3,6 +3,7 @@ REBOOT_USER=$(logname) REBOOT_TIME=$(date) REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt" +PLATFORM_REBOOT_PRE_CHECK="platform_reboot_pre_check" WARM_DIR=/host/warmboot REDIS_FILE=dump.rdb CONFIG_DB_FILE=/etc/sonic/config_db.json @@ -174,6 +175,10 @@ function initialize_pre_shutdown() 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} + 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) if [[ x"${STATE}" == x"timed out" ]]; then From 96b0bad69c034c0592be012942b74c2ae8a26412 Mon Sep 17 00:00:00 2001 From: jhli-cisco <93410383+jhli-cisco@users.noreply.github.com> Date: Fri, 3 Mar 2023 09:46:37 -0800 Subject: [PATCH 2/2] Update fast-reboot --- scripts/fast-reboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 512131549e..b0a4ea0773 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -3,7 +3,6 @@ REBOOT_USER=$(logname) REBOOT_TIME=$(date) REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt" -PLATFORM_REBOOT_PRE_CHECK="platform_reboot_pre_check" WARM_DIR=/host/warmboot REDIS_FILE=dump.rdb CONFIG_DB_FILE=/etc/sonic/config_db.json @@ -24,6 +23,7 @@ PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin" LOG_SSD_HEALTH="/usr/local/bin/log_ssd_health" PLATFORM_FWUTIL_AU_REBOOT_HANDLE="platform_fw_au_reboot_handle" +PLATFORM_REBOOT_PRE_CHECK="platform_reboot_pre_check" SSD_FW_UPDATE="ssd-fw-upgrade" TAG_LATEST=yes DETACH=no