During service kdump start, if firmware assisted dump is not enabled then
fallback to starting of existing kexec based kdump. If firmware assisted
is enabled but not running, then start firmware assisted dump by echo'ing
1 to '/sys/kernel/fadump_registered' file.
Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
kdumpctl | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index d281abb..199d2a9 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -662,6 +662,29 @@ check_dump_feasibility()
return $?
}
+start_fadump()
+{
+ echo 1 > $FADUMP_REGISTER_SYS_NODE
+ if ! check_current_fadump_status; then
+ echo "fadump: failed to register"
+ return 1
+ fi
+
+ echo "fadump: registered successfully"
+ return 0
+}
+
+start_dump()
+{
+ if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ start_fadump
+ else
+ load_kdump
+ fi
+
+ return $?
+}
+
start()
{
check_config
@@ -703,7 +726,8 @@ start()
echo "Starting kdump: [FAILED]"
return 1
fi
- load_kdump
+
+ start_dump
if [ $? != 0 ]; then
echo "Starting kdump: [FAILED]"
return 1