On 02/27/14 at 01:50pm, Hari Bathini wrote:
This patch enables kdump script to check if firmware-assisted dump
is
enabled or not by reading value from '/sys/kernel/fadump_enabled'. The
determine_dump_mode() routine sets dump_mode to 'fadump', if fadump is
enabled. By default, dump_mode is set to 'kdump' mode.
Modify status routine to check if firmware assisted dump is registered
or not by reading value from '/sys/kernel/fadump_registered' file. If
it is set to '1' then return status=0 else return status=1.
0 <= Firmware assisted is enabled and running
1 <= Firmware assisted is enabled but not running
Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
kdumpctl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 61 insertions(+), 3 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 481ffed..0009031 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -9,6 +9,8 @@ MKDUMPRD="/sbin/mkdumprd -f"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
DUMP_TARGET=""
+FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
+FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered"
. /lib/kdump/kdump-lib.sh
@@ -24,6 +26,19 @@ single_instance_lock()
flock 9
}
+determine_dump_mode()
+{
+ # kdump shall be the default dump mode
+ dump_mode="kdump"
Since dump_mode will be used here and there, how about add a global var at the top
of this file as the FADUMP_ENABLED_SYS_NODE etc.
+
+ # Check if firmware-assisted dump is enabled
+ # if yes, set the dump mode as fadump
+ if is_fadump_capable; then
+ echo "Using dump mode fadump"
+ dump_mode="fadump"
+ fi
+}
+
Thanks
Dave