kdumpctrl: kdump feasibility should fail if no crash memory

Currently initramfs is rebuilt even when crash kernel memory is not
available and then latter on kdump service is failed.

Its better to fail during feasibility itself when crash memory is not
reserved.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Acked-by: Xunlei Pang <xlpang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Pratyush Anand 2016-05-12 10:26:39 +05:30 committed by Dave Young
parent 8bf0454bd9
commit afa4a35d3d
1 changed files with 14 additions and 7 deletions

View File

@ -559,13 +559,6 @@ need_64bit_headers()
# as the currently running kernel.
load_kdump()
{
MEM_RESERVED=$(cat /sys/kernel/kexec_crash_size)
if [ $MEM_RESERVED -eq 0 ]
then
echo "No memory reserved for crash kernel." >&2
return 1
fi
ARCH=`uname -m`
if [ "$ARCH" == "i686" -o "$ARCH" == "i386" ]
then
@ -867,12 +860,26 @@ is_secure_boot_enforced()
return 1
}
check_crash_mem_reserved()
{
MEM_RESERVED=$(cat /sys/kernel/kexec_crash_size)
if [ $MEM_RESERVED -eq 0 ]
then
echo "No memory reserved for crash kernel." >&2
return 1
fi
return 0
}
check_kdump_feasibility()
{
if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
echo "Kdump is not supported on this kernel"
return 1
fi
check_crash_mem_reserved
return $?
}
check_fence_kdump_config()