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>
---
kdumpctl | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 0009031..b993e1b 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -581,6 +581,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 [ $dump_mode == "fadump" ]; then
+ start_fadump
+ else
+ load_kdump
+ fi
+
+ return $?
+}
+
function start()
{
check_config
@@ -622,7 +645,8 @@ function start()
echo "Starting kdump: [FAILED]"
return 1
fi
- load_kdump
+
+ start_dump
if [ $? != 0 ]; then
echo "Starting kdump: [FAILED]"
return 1