From 02e0ca9600a64c3475f24a4f6a58c62ac52c250e Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:35:21 -0400 Subject: [PATCH] [Nokia][DeviceData] Update the Nokia platform IXR-7250E device data (#16028) Why I did it Update the platform_reboot of Nokia Platform IXR-7250E-36x400G to displays the correct reboot-cause history when reboot from supervisor card. Work item tracking Microsoft ADO (number only): How I did it Modify the platform_reboot script to copy the correct reboo-cause.txt file from NDK to the /host/reboot-cause directory at the down cycle when the reboot is issued from Supervisor (for both reboot right after install a new image and normal reboot) Signed-off-by: mlok --- .../platform_reboot | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot index 180db164df6..43aace70f7e 100755 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot @@ -1,23 +1,24 @@ #!/bin/bash -update_reboot_cause_for_supervisor_reboot() +update_reboot_cause() { DEVICE_MGR_REBOOT_FILE=/tmp/device_mgr_reboot REBOOT_CAUSE_FILE=/host/reboot-cause/reboot-cause.txt - TMP_REBOOT_CAUSE_FILE=/tmp/tmp-reboot-cause.txt - if [ -f $DEVICE_MGR_REBOOT_FILE ]; then - if [ -f $REBOOT_CAUSE_FILE ]; then - t1=`sudo grep "User: ," $REBOOT_CAUSE_FILE` - if [ ! -z "$t1" ]; then - echo $t1 | sed 's/reboot/reboot from Supervisor/g' | sed 's/User: /User: admin/g' > $TMP_REBOOT_CAUSE_FILE - cp $TMP_REBOOT_CAUSE_FILE $REBOOT_CAUSE_FILE - fi + DEVICE_REBOOT_CAUSE_FILE=/etc/opt/srlinux/reboot-cause.txt + if [ -e $DEVICE_MGR_REBOOT_FILE ]; then + if [ -e $DEVICE_REBOOT_CAUSE_FILE ]; then + cp -f $DEVICE_REBOOT_CAUSE_FILE $REBOOT_CAUSE_FILE fi + rm -f $DEVICE_MGR_REBOOT_FILE + else + touch /etc/opt/srlinux/devmgr_reboot_cause.done + rm -f $DEVICE_REBOOT_CAUSE_FILE &> /dev/null fi + sync } # update the reboot_cuase file when reboot is trigger by device-mgr -update_reboot_cause_for_supervisor_reboot +update_reboot_cause systemctl stop nokia-watchdog.service sleep 2 @@ -25,7 +26,5 @@ echo "w" > /dev/watchdog kick_date=`date -u` echo "last watchdog kick $kick_date" > /var/log/nokia-watchdog-last.log rm -f /sys/firmware/efi/efivars/dump-* -touch /etc/opt/srlinux/devmgr_reboot_cause.done -rm -f /etc/opt/srlinux/reboot-cause.txt sync exec /sbin/reboot $@