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 --- Changes since V1: * return 1 is false and 0 is true * crash memory availability is checked in check_kdump_feasibility now
kdumpctl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 34b64f33ac40..fcc9ad081437 100755 --- a/kdumpctl +++ b/kdumpctl @@ -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()
On 2016/05/12 at 12:56, Pratyush Anand wrote:
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
Changes since V1:
- return 1 is false and 0 is true
- crash memory availability is checked in check_kdump_feasibility now
kdumpctl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 34b64f33ac40..fcc9ad081437 100755 --- a/kdumpctl +++ b/kdumpctl @@ -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()
Acked-by: Xunlei Pang xlpang@redhat.com
On 05/12/16 at 10:26am, Pratyush Anand wrote:
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
Changes since V1:
- return 1 is false and 0 is true
- crash memory availability is checked in check_kdump_feasibility now
kdumpctl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 34b64f33ac40..fcc9ad081437 100755 --- a/kdumpctl +++ b/kdumpctl @@ -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()
2.5.5 _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/kexec@lists.fedoraproject.org
Will correct the subject s/kdumpctrl/kdumpctl when merging it.
Acked-by: Dave Young dyoung@redhat.com
Thanks Dave
On 05/12/16 at 10:26am, Pratyush Anand wrote:
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
This makes much sense, ack.
Acked-by: Baoquan He bhe@redhat.com
Changes since V1:
- return 1 is false and 0 is true
- crash memory availability is checked in check_kdump_feasibility now
kdumpctl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 34b64f33ac40..fcc9ad081437 100755 --- a/kdumpctl +++ b/kdumpctl @@ -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()
2.5.5 _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/kexec@lists.fedoraproject.org