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 <piliu@redhat.com>
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
Coiby Xu 2021-11-16 12:23:02 +08:00
parent 105c01691a
commit 796d0f6fd2
1 changed files with 10 additions and 0 deletions

View File

@ -1273,6 +1273,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
@ -1361,6 +1368,9 @@ main()
estimate)
do_estimate
;;
get-default-crashkernel)
get_default_crashkernel "$2"
;;
reset-crashkernel)
reset_crashkernel "$2"
;;