Skip to content

Commit 97a091a

Browse files
authored
[Mellanox] Use Debian reboot in Nvidia platform reboot when it is invoked from kdump capture boot (#15701)
#### Why I did it When a kernel crash occurs, the system will reboot to the kdump capture kernel if kdump is enabled (`config kdump enable`). In the kdump capture boot, it only stores the crash information, and then reboot the system to a normal boot. In this boot, no SONiC service is started but it invokes `reboot` which is actually the SONiC reboot that depends on SONiC services. There is a logic to skip all SONiC stuff and invoke platform reboot in SONiC reboot to avoid issues. However, on Nvidia platforms, the platform reboot still depends on SONiC services, which can cause issues. So, the Debian reboot is called directly in platform reboot if it is invoked from the kdump capture boot. #### How I did it Manual test
1 parent f1a4fbb commit 97a091a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,24 @@ function ParseArguments() {
2121
}
2222

2323
function SafePwrCycle() {
24-
sync ; sync
25-
umount -fa > /dev/null 2&>1
24+
sync; sync
25+
umount -fa > /dev/null 2>&1
2626
echo 1 > $SYSFS_PWR_CYCLE
2727
}
2828

2929
ParseArguments "$@"
3030

31+
# Reboot immediately if the kdump capture kernel is running
32+
VMCORE_FILE=/proc/vmcore
33+
if [ -s $VMCORE_FILE ]; then
34+
sync; sync
35+
umount -fa > /dev/null 2>&1
36+
37+
# Run Debian reboot because the platform reboot isn't available
38+
/sbin/reboot
39+
fi
40+
41+
3142
${FW_UPGRADE_SCRIPT} --upgrade --verbose
3243
EXIT_CODE="$?"
3344
if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then

0 commit comments

Comments
 (0)