This function would be used to read kernel cmdline parameter like fadump
or crashkernel.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 998ac6e..42730cb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1423,6 +1423,14 @@ _update_kernel_cmdline_in_grub_etc_default()
}" "$GRUB_ETC_DEFAULT"
}
+# read the kernel command line parameter in default grub conf
+#
+# $1: the name of the kernel command line parameter
+_read_kernel_cmdline_in_grub_etc_default()
+{
+ sed -n -E
"s/^GRUB_CMDLINE_LINUX=.*[[:space:]\"]${1}=([^[:space:]\"]*).*$/\1/p"
"$GRUB_ETC_DEFAULT"
+}
+
reset_crashkernel()
{
local _opt _val _dump_mode _fadump_val _reboot _grubby_kernel_path _kernel _kernels
--
2.34.1