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 dumpings require network 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@redhat.com --- v3->v4: -No change.
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