diff --git a/scripts/fast-reboot b/scripts/fast-reboot index b2058782da..60d9c73c38 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -17,6 +17,7 @@ WATCHDOG_UTIL="/usr/bin/watchdogutil" DEVPATH="/usr/share/sonic/device" PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin" +SSD_FW_UPDATE="ssd-fw-upgrade" # Require 100M available on the hard drive for warm reboot temp files, # Size is in 1K blocks: @@ -602,6 +603,12 @@ if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN} ]; then ${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN} fi +# Run platform specific ssd firmware update plugin +if [ -x ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ]; then + debug "Updating ssd fw for ${REBOOT_TYPE}" + ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ${REBOOT_TYPE} +fi + # Reboot: explicity call Linux native reboot under sbin debug "Rebooting with ${REBOOT_METHOD} to ${NEXT_SONIC_IMAGE} ..." exec ${REBOOT_METHOD} diff --git a/scripts/reboot b/scripts/reboot index 4a70085f33..404bb187bc 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -5,11 +5,14 @@ REBOOT_TIME=$(date) PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type) DEVPATH="/usr/share/sonic/device" +REBOOT_SCRIPT_NAME=$(basename $0) +REBOOT_TYPE="${REBOOT_SCRIPT_NAME}" PLAT_REBOOT="platform_reboot" REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt" PLATFORM_REBOOT_PRE_CHECK="platform_reboot_pre_check" VERBOSE=no EXIT_NEXT_IMAGE_NOT_EXISTS=4 +SSD_FW_UPDATE="ssd-fw-upgrade" function debug() { @@ -130,6 +133,12 @@ if [ -x /sbin/hwclock ]; then /sbin/hwclock -w || /bin/true fi +# Run platform specific ssd firmware update plugin +if [ -x ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ]; then + debug "Updating ssd fw for ${REBOOT_TYPE}" + ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ${REBOOT_TYPE} +fi + if [ -x ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ]; then VERBOSE=yes debug "Rebooting with platform ${PLATFORM} specific tool ..." exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@ diff --git a/scripts/soft-reboot b/scripts/soft-reboot index 4ccec02e22..3c7c9b6261 100755 --- a/scripts/soft-reboot +++ b/scripts/soft-reboot @@ -5,10 +5,10 @@ REBOOT_TIME=$(date) PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type) DEVPATH="/usr/share/sonic/device" -REBOOT_SCRIPT_NAME=$(basename $0) -REBOOT_TYPE="${REBOOT_SCRIPT_NAME}" +REBOOT_TYPE="soft-reboot" REBOOT_METHOD="/sbin/kexec -e" PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin" +SSD_FW_UPDATE="ssd-fw-upgrade" REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt" WATCHDOG_UTIL="/usr/bin/watchdogutil" VERBOSE=no @@ -174,6 +174,12 @@ if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN} ]; then ${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN} fi +# Run platform specific ssd firmware update plugin +if [ -x ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ]; then + debug "Updating ssd fw for ${REBOOT_TYPE}" + ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ${REBOOT_TYPE} +fi + # Reboot: explicitly call Linux native reboot under sbin debug "Rebooting with ${REBOOT_METHOD} to ${NEXT_SONIC_IMAGE} ..." exec ${REBOOT_METHOD}