Skip to content

Commit a28352e

Browse files
authored
[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 <[email protected]>
1 parent 6c96b29 commit a28352e

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
#!/bin/bash
22

3-
update_reboot_cause_for_supervisor_reboot()
3+
update_reboot_cause()
44
{
55
DEVICE_MGR_REBOOT_FILE=/tmp/device_mgr_reboot
66
REBOOT_CAUSE_FILE=/host/reboot-cause/reboot-cause.txt
7-
TMP_REBOOT_CAUSE_FILE=/tmp/tmp-reboot-cause.txt
8-
if [ -f $DEVICE_MGR_REBOOT_FILE ]; then
9-
if [ -f $REBOOT_CAUSE_FILE ]; then
10-
t1=`sudo grep "User: ," $REBOOT_CAUSE_FILE`
11-
if [ ! -z "$t1" ]; then
12-
echo $t1 | sed 's/reboot/reboot from Supervisor/g' | sed 's/User: /User: admin/g' > $TMP_REBOOT_CAUSE_FILE
13-
cp $TMP_REBOOT_CAUSE_FILE $REBOOT_CAUSE_FILE
14-
fi
7+
DEVICE_REBOOT_CAUSE_FILE=/etc/opt/srlinux/reboot-cause.txt
8+
if [ -e $DEVICE_MGR_REBOOT_FILE ]; then
9+
if [ -e $DEVICE_REBOOT_CAUSE_FILE ]; then
10+
cp -f $DEVICE_REBOOT_CAUSE_FILE $REBOOT_CAUSE_FILE
1511
fi
12+
rm -f $DEVICE_MGR_REBOOT_FILE
13+
else
14+
touch /etc/opt/srlinux/devmgr_reboot_cause.done
15+
rm -f $DEVICE_REBOOT_CAUSE_FILE &> /dev/null
1616
fi
17+
sync
1718
}
1819

1920
# update the reboot_cuase file when reboot is trigger by device-mgr
20-
update_reboot_cause_for_supervisor_reboot
21+
update_reboot_cause
2122

2223
systemctl stop nokia-watchdog.service
2324
sleep 2
2425
echo "w" > /dev/watchdog
2526
kick_date=`date -u`
2627
echo "last watchdog kick $kick_date" > /var/log/nokia-watchdog-last.log
2728
rm -f /sys/firmware/efi/efivars/dump-*
28-
touch /etc/opt/srlinux/devmgr_reboot_cause.done
29-
rm -f /etc/opt/srlinux/reboot-cause.txt
3029
sync
3130
exec /sbin/reboot $@

0 commit comments

Comments
 (0)