On Tue, Feb 11, 2014 at 03:06:06PM +0800, Dave Young wrote:
Move the code to check /sys/kernel/kexec_crash_loaded to function
check_kdump_feasibility(). And rename status() to check_current_kdump_status()
so these two functions become clearer.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
kdumpctl | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
--- kexec-tools.orig/kdumpctl
+++ kexec-tools/kdumpctl
@@ -384,12 +384,8 @@ function propagate_ssh_key()
}
-function status()
+function check_current_kdump_status()
{
- if [ ! -e /sys/kernel/kexec_crash_loaded ]
- then
- return 2
- fi
rc=`cat /sys/kernel/kexec_crash_loaded`
if [ $rc == 1 ]; then
return 0
@@ -534,6 +530,10 @@ function check_kdump_feasibility()
if is_secure_boot_enforced; then
return 1;
fi
+
+ if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
+ return 2
+ fi
We should be able to just return "1" here if we make changes as suggested
in last function. Also it does not hurt to give a warning/error message here.
Thanks
Vivek