On Wed, 8 Dec 2021 10:25:30 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
Provide "kdumpctl get_default_crashkernel" for
kdump_anaconda_addon
s/get_default_crashkernel/get-default-crashkernel/
Thanks
Philipp
so crashkernel.default isn't needed.
When fadump is on, kdump_anaconda_addon would need to specify the dump
mode, i.e. "kdumpctl get-default-crashkernel fadump".
This interface would also be used by RPM scriptlet [1] to fetch default
crashkernel value.
[1]
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 59ec068..1938968 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1299,6 +1299,13 @@ do_estimate()
fi
}
+get_default_crashkernel()
+{
+ local _dump_mode=$1
+
+ echo -n "$(kdump_get_arch_recommend_crashkernel "$_dump_mode")"
+}
+
reset_crashkernel()
{
local kernel=$1 entry crashkernel_default
@@ -1392,6 +1399,9 @@ main()
estimate)
do_estimate
;;
+ get-default-crashkernel)
+ get_default_crashkernel "$2"
+ ;;
reset-crashkernel)
reset_crashkernel "$2"
;;