kdump: Modify kdump script to stop firmware assisted dump
During service kdump stop, if firmware assisted dump is enabled and running, then stop firmware assisted dump by echo'ing 0 to '/sys/kernel/fadump_registered' file. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
734790aa75
commit
9f7b8b03b4
39
kdumpctl
39
kdumpctl
@ -736,18 +736,45 @@ start()
|
||||
echo "Starting kdump: [OK]"
|
||||
}
|
||||
|
||||
stop()
|
||||
stop_fadump()
|
||||
{
|
||||
echo 0 > $FADUMP_REGISTER_SYS_NODE
|
||||
if check_current_fadump_status; then
|
||||
echo "fadump: failed to unregister"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "fadump: unregistered successfully"
|
||||
return 0
|
||||
}
|
||||
|
||||
stop_kdump()
|
||||
{
|
||||
$KEXEC -p -u 2>/dev/null
|
||||
if [ $? == 0 ]; then
|
||||
echo "kexec: unloaded kdump kernel"
|
||||
echo "Stopping kdump: [OK]"
|
||||
return 0
|
||||
else
|
||||
if [ $? != 0 ]; then
|
||||
echo "kexec: failed to unload kdump kernel"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "kexec: unloaded kdump kernel"
|
||||
return 0
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
|
||||
stop_fadump
|
||||
else
|
||||
stop_kdump
|
||||
fi
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
echo "Stopping kdump: [FAILED]"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "Stopping kdump: [OK]"
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user