Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:17483] [Nokia-IXR7250E] Modify the platform_reboot on the IXR7250E for PMON API reboot and disable all SFPs #17816

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ update_reboot_cause()
sync
}

echo "Disable all SFPs"
python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.tx_disable_all_sfps()'
sleep 3

# update the reboot_cuase file when reboot is trigger by device-mgr
update_reboot_cause

Expand Down
34 changes: 29 additions & 5 deletions device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
#!/bin/bash
echo "Rebooting all Linecards"
python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.reboot_imms()'
sleep 3

DEVICE_MGR_REBOOT_FILE="/tmp/device_mgr_reboot"

update_reboot_cause()
{
DEVICE_MGR_REBOOT_FILE=/tmp/device_mgr_reboot
REBOOT_CAUSE_FILE=/host/reboot-cause/reboot-cause.txt
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
}

if [ ! -e $DEVICE_MGR_REBOOT_FILE ]; then
echo "Rebooting all Linecards"
python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.reboot_imms()'
sleep 3
fi

# update the reboot_cuase file when reboot is trigger by device-mgr
update_reboot_cause

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
echo "Shutdown midplane"
ifconfig xe0 down
sync
Expand Down