sonic-buildimage/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot
Marty Y. Lok 4c707cbf25 [Nokia][device-data] Modify the Nokia-7250IXRE platform specific reboot script (#14568)
Why I did it

When reboot the chassis by issuing "sudo reboot" on Supervisor card. The internal midplane communication xe0 should be shutdown to avoid double reboot on the linecard.
Added a udev link rule to disable the autoneg on AMD xgbe port Xe0 and Xe1 and make the setting in sync with the peer Broadcom greyhound ports.

How I did it

Modify the Nokia-7250IXRE specific reboot script on the Supervisor card to shutdown the internal interface xe0. Also move reboot linecard code to the top of the script to make sure the notification has been send to Linecard before shutdown the xe0 interface.
Introduced a new rule 80-net-by-driver.link to disable the autoneg on the AMD size. This change requires the latest NDK which contains the change to set the autoneg on the xe0 and xe1 port on the Greyhound.

Signed-off-by: mlok <marty.lok@nokia.com>
2023-05-17 14:32:57 +08:00

32 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
update_reboot_cause_for_supervisor_reboot()
{
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
fi
fi
}
# update the reboot_cuase file when reboot is trigger by device-mgr
update_reboot_cause_for_supervisor_reboot
systemctl stop nokia-watchdog.service
sleep 2
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 $@