Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Expand Down
9 changes: 9 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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} $@
Expand Down
10 changes: 8 additions & 2 deletions scripts/soft-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down