On Thu, Dec 23, 2021 at 12:22:54PM +0800, Coiby Xu wrote:
Hi Philipp,
[...]
>>+ # Only ppc64le supports fadump. If not specified for
ppc64le, the dump
>>+ # mode would be determined by parsing the kernel command line of the
>>+ # kernel(s) to be updated
>>+ if [[ -z $_dump_mode && $(uname -m) != ppc64le ]]; then
>>+ _dump_mode=kdump
>>+ fi
>
>
>I don't think this will work. The way I see it $_dump_mode will always
>be set after this if-block. But that will make all tests for
>-n/-z $_dump_mode predetermined. Which is not what you want. E.g. ...
_dump_mode is set to kdump only for non-ppc systems. So this is
something I want.
>
>>+ if [[ -n $_dump_mode ]]; then
>>+ _crashkernel=$(kdump_get_arch_recommend_crashkernel "$_dump_mode")
>>+ _fadump_val=off
>>+ fi
>
>... this will always turn off fadump independent what the user gave on
>the command line.
But the above statement is correct. I'll move _fadump_val=off else where,
i.e.,
+ # For non-ppc64le systems, the dump mode is always kdump since only ppc64le
+ # has FADump.
+ if [[ -z $_dump_mode && $(uname -m) != ppc64le ]]; then
+ _dump_mode=kdump
+ _fadump_val=off
+ fi
+
+ # If the dump mode is determined, we can also know the default crashkernel value
+ if [[ -n $_dump_mode ]]; then
+ _crashkernel=$(kdump_get_arch_recommend_crashkernel
"$_dump_mode")
+ fi
Thanks for catching this problem!
--
Best regards,
Coiby