On 07/07/2017 at 11:16 AM, Dave Young wrote:
Hi Xunlei,
On 07/06/17 at 02:37pm, Xunlei Pang wrote:
> I noticed that network is still enabled for local dumping,
> like the following kdump boot message on my test machine
> using local disk as the dump target:
> tg3.c:v3.137 (May 11, 2014)
> tg3 0000:02:00.0 eth2: Tigon3 [partno(BCM95720) rev
> (PCI Express) MAC address c8:1f:66:c9:35:0d
> tg3 0000:02:00.0 eth2: attached PHY is 5720C
>
> After some debugging, found it due to a misuse in code below:
> if [ is_generic_fence_kdump -o is_pcs_fence_kdump ]; then
> _dep="$_dep network"
> fi
> The "if" condition always results in "true", and should be
> changed as follows:
> if is_generic_fence_kdump -o is_pcs_fence_kdump; then
> _dep="$_dep network"
> fi
>
> After this, network won't be involved in non-network dumping,
> as for network related dumping such as nfs/ssh/iscsi/fcoe/etc,
> dracut will add network accordingly. And kdump initramfs size
> can be reduced from 24MB to 17MB tested on some real hardware,
> and from 19MB to 14MB on my kvm. Moreover, it could avoid the
> network (driver) initialization thereby saving us more memory.
>
> Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
> ---
> dracut-module-setup.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index 8495fd9..59b4f04 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -24,7 +24,7 @@ depends() {
> _dep="$_dep drm"
> fi
>
> - if [ is_generic_fence_kdump -o is_pcs_fence_kdump ]; then
> + if is_generic_fence_kdump -o is_pcs_fence_kdump; then
> _dep="$_dep network"
> fi
>
> --
> 1.8.3.1
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
Good catch and looks good.
Do you see anywhere about the documentation of the behavior in bash
guide?
No, just found it not my way of using function as conditions, and did some tests.
Regards,
Xunlei