kdumpctl: move is_fadump_capable() to kdump-lib.sh
Make is_fadump_capable() a library function, as we will need it in mkdumprd. Signed-off-by: Xunlei Pang <xlpang@redhat.com> Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
parent
1bd757bc96
commit
d5fe9022d0
12
kdump-lib.sh
12
kdump-lib.sh
@ -6,6 +6,18 @@
|
||||
DEFAULT_PATH="/var/crash/"
|
||||
FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
|
||||
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
|
||||
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
|
||||
|
||||
is_fadump_capable()
|
||||
{
|
||||
# Check if firmware-assisted dump is enabled
|
||||
# if no, fallback to kdump check
|
||||
if [ -f $FADUMP_ENABLED_SYS_NODE ]; then
|
||||
rc=`cat $FADUMP_ENABLED_SYS_NODE`
|
||||
[ $rc -eq 1 ] && return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
perror_exit() {
|
||||
echo $@ >&2
|
||||
|
12
kdumpctl
12
kdumpctl
@ -13,7 +13,6 @@ DUMP_TARGET=""
|
||||
DEFAULT_INITRD=""
|
||||
DEFAULT_INITRD_BAK=""
|
||||
TARGET_INITRD=""
|
||||
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
|
||||
FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered"
|
||||
#kdump shall be the default dump mode
|
||||
DEFAULT_DUMP_MODE="kdump"
|
||||
@ -893,17 +892,6 @@ handle_mode_switch()
|
||||
fi
|
||||
}
|
||||
|
||||
is_fadump_capable()
|
||||
{
|
||||
# Check if firmware-assisted dump is enabled
|
||||
# if no, fallback to kdump check
|
||||
if [ -f $FADUMP_ENABLED_SYS_NODE ]; then
|
||||
rc=`cat $FADUMP_ENABLED_SYS_NODE`
|
||||
[ $rc -eq 1 ] && return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
check_current_fadump_status()
|
||||
{
|
||||
# Check if firmware-assisted dump has been registered.
|
||||
|
Loading…
Reference in New Issue
Block a user