From 99673bcd54cfafe6a41586210bf47df2a5bc049f Mon Sep 17 00:00:00 2001 From: rkdevi27 <54701695+rkdevi27@users.noreply.github.com> Date: Mon, 1 Mar 2021 01:49:05 +0530 Subject: [PATCH] [reboot] Add platform-specific reboot cause update hook (#1454) #### What I did The S6000 devices, the cold reboot is abrupt and it is likely to cause issues which will cause the device to land into EFI shell. Hence the platform reboot will happen after graceful unmount of all the filesystems as in S6100. #### How I did it In reboot script, if platform-specific reboot cause update script exists, run it --- scripts/reboot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/reboot b/scripts/reboot index 889f4c4bd547..8b1f9d60c328 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -1,6 +1,7 @@ #!/bin/bash DEVPATH="/usr/share/sonic/device" PLAT_REBOOT="platform_reboot" +PLATFORM_UPDATE_REBOOT_CAUSE="platform_update_reboot_cause" REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt" REBOOT_TIME=$(date) @@ -167,6 +168,11 @@ if [ -x ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ]; then ${DEVPATH}/${PLATFORM}/${SSD_FW_UPDATE} ${REBOOT_TYPE} fi +if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_UPDATE_REBOOT_CAUSE} ]; then + debug "updating reboot cause for ${PLATFORM}" + ${DEVPATH}/${PLATFORM}/${PLATFORM_UPDATE_REBOOT_CAUSE} +fi + if [ -x ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ]; then VERBOSE=yes debug "Rebooting with platform ${PLATFORM} specific tool ..." exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@