mkdumprd: omit dracut modules in case of network dumping

In case of only network target, we can clearly and safely
remove more unnecessary modules to reduce initramfs size,
and to enhance stability.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Xunlei Pang 2017-07-07 15:48:58 +08:00 committed by Dave Young
parent 821d1af080
commit fb522e972c

View File

@ -385,12 +385,13 @@ crypt_exists=0
omit_dracut_modules() omit_dracut_modules()
{ {
local target majmin local target majmin
local dm_exists local dm_exists network_only
# Skip fadump case # Skip fadump case
is_fadump_capable && return is_fadump_capable && return
dm_exists=0 dm_exists=0
network_only=1
for target in $(get_kdump_targets); do for target in $(get_kdump_targets); do
if [ -b "$target" ]; then if [ -b "$target" ]; then
@ -398,6 +399,9 @@ omit_dracut_modules()
# Check "dm" # Check "dm"
check_block_and_slaves is_dm $majmin && dm_exists=1 check_block_and_slaves is_dm $majmin && dm_exists=1
fi fi
# Check nfs/ssh dumping
[[ "$target" != "nfs" && "$target" != "ssh" ]] && network_only=0
done done
# Omit "crypt", BZ1451717 # Omit "crypt", BZ1451717
@ -410,6 +414,12 @@ omit_dracut_modules()
# "dm_exists=0" implies "crypt_exists=0" # "dm_exists=0" implies "crypt_exists=0"
add_dracut_arg "--omit" "lvm dm multipath dmraid" add_dracut_arg "--omit" "lvm dm multipath dmraid"
fi fi
# Further omit more modules in case of nfs/ssh dumping
if [ "$network_only" == "1" ]; then
# "network_only=1" implies "dm_exists=0"
add_dracut_arg "--omit" "iscsi fcoe fcoe-uefi"
fi
} }
if ! check_resettable; then if ! check_resettable; then