Skip to content

Commit

Permalink
Revert the change to kdump reboot (sonic-net#916)
Browse files Browse the repository at this point in the history
This is to revert the change to the reboot command in 7105400.

Platform reboot is not supported by the kdump kernel, as the platform drivers are not loaded. With the existing code, there are some error messages printed, but the device is still rebooted by CPU. The change here helps to avoid the error messages.
  • Loading branch information
byu343 authored May 28, 2020
1 parent 5765570 commit d03d151
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions scripts/reboot
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash

# Reboot immediately if we run the kdump capture kernel
VMCORE_FILE=/proc/vmcore
if [ -e $VMCORE_FILE -a -s $VMCORE_FILE ]; then
echo "We have a /proc/vmcore, then we just kdump'ed"
/sbin/reboot
fi

REBOOT_USER=$(logname)
REBOOT_TIME=$(date)
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
Expand All @@ -18,18 +25,6 @@ function debug()
logger "$@"
}

# Reboot immediately if we run the kdump capture kernel
VMCORE_FILE=/proc/vmcore
if [ -e $VMCORE_FILE -a -s $VMCORE_FILE ]; then
debug "We have a /proc/vmcore, then we just kdump'ed"
if [ -x ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} ]; then
VERBOSE=yes debug "Rebooting with platform ${PLATFORM} specific tool ..."
exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT}
else
/sbin/reboot
fi
fi

function stop_sonic_services()
{
if [[ x"$ASIC_TYPE" != x"mellanox" ]]; then
Expand Down

0 comments on commit d03d151

Please sign in to comment.