Skip to content

Commit

Permalink
Enable the platform specific ssd firmware upgrade during reboot (soni…
Browse files Browse the repository at this point in the history
…c-net#954)

- What I did
Implemented the routines for ssd firmware upgrade via normal-reboot, fast-reboot and warm-reboot 

- How I did it
The SSD will be upgraded using ssd-fw-upgrade script which is being called by reboot scripts.
The files required for upgrade will be shared offline.

- How to verify it
The files has to be placed in /tmp and reboot(reboot/fast-reboot/warm-reboot) commands has to be issued.
  • Loading branch information
rkdevi27 authored Aug 24, 2020
1 parent 71c6d65 commit b4a53be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DEVPATH="/usr/share/sonic/device"
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin"
LOG_SSD_HEALTH="/usr/bin/log_ssd_health"

SSD_FW_UPDATE="ssd-fw-upgrade"
# Require 100M available on the hard drive for warm reboot temp files,
# Size is in 1K blocks:
MIN_HD_SPACE_NEEDED=100000
Expand Down Expand Up @@ -630,6 +630,11 @@ if [ -x /sbin/hwclock ]; then
/sbin/hwclock -w || /bin/true
fi
if [ -x ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ]; then
debug "updating ssd fw for${REBOOT_TYPE}"
${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ${REBOOT_TYPE}
fi
# Enable Watchdog Timer
if [ -x ${WATCHDOG_UTIL} ]; then
debug "Enabling Watchdog before ${REBOOT_TYPE}"
Expand Down
8 changes: 8 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt"
VERBOSE=no
EXIT_NEXT_IMAGE_NOT_EXISTS=4
EXIT_SONIC_INSTALLER_VERIFY_REBOOT=21
SSD_FW_UPDATE="ssd-fw-upgrade"
REBOOT_SCRIPT_NAME=$(basename $0)
REBOOT_TYPE="${REBOOT_SCRIPT_NAME}"

function debug()
{
Expand Down Expand Up @@ -133,6 +136,11 @@ if [ -x /sbin/hwclock ]; then
/sbin/hwclock -w || /bin/true
fi

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

0 comments on commit b4a53be

Please sign in to comment.