On Fri, Nov 19, 2021 at 04:24:58PM +0800, Pingfan Liu wrote:
On Fri, Nov 19, 2021 at 2:42 PM Coiby Xu coxu@redhat.com wrote:
[...]
As the above question, could you enlighten me about how to get the correct "crashkernel=" in the series ?
For crashkernel=auto, there are three cases where we need to get crashkernel value,
- when installing OS
kdump-anaconda-addon will call "kdumpctl get-default-crashkernel" to get the value. If the user chooses to enable fadump, the addon would call "kdumpctl get-default-crashkernel fadump" instead.
- when the user toggles fadump on
a) kdumpctl would add "fadump=on" to the specified kernel cmdline. b) reset_crashkernel would call get_dump_mode_of_kernel which would return fadump since fadump=on is found in the kernel cmdline. c) Then kdump_get_arch_recommend_crashkernel "$_dump_mode" would return the fadump default crashkernel.
This is what I was concerned about. And I think you can avoid to call grubby twice by taking the "1" way, something like "kdumpctl get-default-crashkernel fadump=on"
Thanks for the suggestion! I'll try to find a way to avoid calling grubby twice.
Thanks,
Pingfan