Resolves: bz1140774 https://bugzilla.redhat.com/show_bug.cgi?id=1140774
If the grub kernel commandline is set to crashkernel=auto, it will not expand the crashkernel=auto in the /proc/cmdline. It still says crashkernel=auto.
Using /sys to determines crashkernel actual size is confusing since there is no unit of measure.
Add a new command "kdumpctl showmem" to show the reserved memory kindly.
Signed-off-by: Minfei Huang mhuang@redhat.com Acked-by: Vivek Goyal vgoyal@redhat.com Acked-by: Baoquan He bhe@redhat.com --- kdumpctl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl index 5b2b3a3..029ded9 100755 --- a/kdumpctl +++ b/kdumpctl @@ -556,6 +556,14 @@ propagate_ssh_key() fi }
+show_reserved_mem() +{ + local mem=$(cat /sys/kernel/kexec_crash_size) + local mem_mb=$(expr $mem / 1024 / 1024) + + echo "Reserved "$mem_mb"MB memory for crash kernel" +} + is_fadump_capable() { # Check if firmware-assisted dump is enabled @@ -967,8 +975,11 @@ main () propagate) propagate_ssh_key ;; + showmem) + show_reserved_mem + ;; *) - echo $"Usage: $0 {start|stop|status|restart|propagate}" + echo $"Usage: $0 {start|stop|status|restart|propagate|showmem}" exit 1 esac }