Skip to content

Commit

Permalink
Platform plugin for Fast-reboot/warm-reboot (#740)
Browse files Browse the repository at this point in the history
* Fastboot/warmboot platform plugin

* Added platform plugin
  • Loading branch information
santhosh-kt authored and yxieca committed Dec 5, 2019
1 parent 640f4a7 commit 771f468
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ STRICT=no
REBOOT_METHOD="/sbin/kexec -e"
ASSISTANT_IP_LIST=""
ASSISTANT_SCRIPT="/usr/bin/neighbor_advertiser"
DEVPATH="/usr/share/sonic/device"
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin"

# Require 100M available on the hard drive for warm reboot temp files,
# Size is in 1K blocks:
Expand Down Expand Up @@ -513,6 +516,11 @@ if [ -x /sbin/hwclock ]; then
/sbin/hwclock -w || /bin/true
fi
if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN} ]; then
debug "Running ${PLATFORM} specific plugin..."
${DEVPATH}/${PLATFORM}/${PLATFORM_PLUGIN}
fi
# Reboot: explicity call Linux native reboot under sbin
debug "Rebooting with ${REBOOT_METHOD} to ${NEXT_SONIC_IMAGE} ..."
exec ${REBOOT_METHOD}
Expand Down

0 comments on commit 771f468

Please sign in to comment.