From acf9f64ca6a3ce55dce78d2eda81d8754b098c27 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Wed, 5 Jan 2022 11:53:09 +0800 Subject: [PATCH] provide kdumpctl get-default-crashkernel for kdump_anaconda_addon and RPM scriptlet Resolves: bz1895258 Upstream: Fedora Conflict: None commit 796d0f6fd2932fd7c009f4517133b1a9c39501e5 Author: Coiby Xu Date: Tue Nov 16 12:23:02 2021 +0800 provide kdumpctl get-default-crashkernel for kdump_anaconda_addon and RPM scriptlet Provide "kdumpctl get-default-crashkernel" for kdump_anaconda_addon 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/ Reviewed-by: Pingfan Liu Reviewed-by: Philipp Rudo Signed-off-by: Coiby Xu Signed-off-by: Coiby Xu --- kdumpctl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kdumpctl b/kdumpctl index 89cf3d3..8b56fc6 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1299,6 +1299,13 @@ do_estimate() fi } +get_default_crashkernel() +{ + local _dump_mode=$1 + + 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" ;;