在 2019年05月15日 16:22, Kairui Song 写道:
On Wed, May 15, 2019 at 4:18 PM lijiang <lijiang(a)redhat.com>
wrote:
>
> 在 2019年05月15日 15:38, Kairui Song 写道:
>> On Fri, May 10, 2019 at 4:37 PM Lianbo Jiang <lijiang(a)redhat.com> wrote:
>>>
>>> Early kdump inherits the settings of normal kdump, so any changes that
>>> caused normal kdump rebuilding also require rebuilding the system initramfs
>>> to make sure that the changes take effect for early kdump.
>>>
>>> Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
>>> ---
>>> kdumpctl | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/kdumpctl b/kdumpctl
>>> index 75eebacef92b..7c2f53cabe59 100755
>>> --- a/kdumpctl
>>> +++ b/kdumpctl
>>> @@ -628,6 +628,7 @@ check_rebuild()
>>> fi
>>>
>>> echo "Rebuilding $TARGET_INITRD"
>>> + echo "Tips: If early kdump is enabled, also require rebuilding
the system initramfs to ensure that the changes take effect for early kdump."
>>> rebuild_initrd
>>> return $?
>>> }
>>> @@ -1140,6 +1141,7 @@ rebuild() {
>>> fi
>>>
>>> echo "Rebuilding $TARGET_INITRD"
>>> + echo "Tips: If early kdump is enabled, also require rebuilding
the system initramfs to ensure that the changes take effect for early kdump."
>>> rebuild_initrd
>>> return $?
>>> }
>>> --
>>> 2.17.1
>>>
>>
>> Hi Lianbo,
>>
>> Will it be a bit noise if we print this message every time it rebuilds
>> even if user don't use early kdump? Is there a way to know if user is
>> using early kdump?
>>
>
> There is a way to check if user is using early kdump as follow:
>
> cat /proc/cmdline |grep "rd.earlykdump" && lsinitrd
/boot/initramfs-xxx.img |grep "earlykdump"
>
> When two conditions are true, we can know that. However, that will make the code
become complicated.
>
> What's your opinion?
>
> Thanks.
Hi, I think check cmdline would be good enough, lsinitrd
/boot/initramfs-xxx.img would be too slow.
In theory, it's not enough to only check the cmdline, but that could reduce
some of printed information.
I will add a new function in the kdumpctl file as follow:
check_earlykdump_is_enabled()
{
rc=`grep -w "rd.earlykdump" /proc/cmdline`
[ -z "$rc" ] && return 1
return 0
}
if check_earlykdump_is_enabled; then
echo "Tips: If early kdump is enabled, also require rebuilding the system
initramfs to ensure that the changes take effect for early kdump."
fi
Thanks.
Lianbo