This helper function will be used to retrieve the value of kernel
cmdline parameters including crashkernel, fadump, swiotlb and etc.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 1938968..6f1afad 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1304,6 +1304,15 @@ get_default_crashkernel()
local _dump_mode=$1
echo -n "$(kdump_get_arch_recommend_crashkernel "$_dump_mode")"
+ }
+
+# Read kernel cmdline parameter for a specific kernel
+# $1: kernel path, DEFAULT or kernel path
+# $2: kernel cmldine parameter
+get_grub_kernel_boot_parameter() {
+ local _kernel_path=$1 _para=$2
+
+ grubby --info="$_kernel_path" | sed -n
's/^args="\(.*\)"$/\1/p' | sed -n
"s/^.*${_para}=\(\S*\).*/\1/p"
}
reset_crashkernel()
--
2.31.1