From 771f468b5c1b01a4f787a6072b7af6332c231807 Mon Sep 17 00:00:00 2001 From: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com> Date: Fri, 6 Dec 2019 03:58:49 +0530 Subject: [PATCH] Platform plugin for Fast-reboot/warm-reboot (#740) * Fastboot/warmboot platform plugin * Added platform plugin --- scripts/fast-reboot | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index e59f3dcbb5..f35c3126d3 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -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: @@ -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}