Revert "mkdumprd: omit dracut modules in case of no dm target"

This reverts commit 821d1af080.

We are going to add "--no-hostonly-default-device" dracut argument
in the following patch.

With the help of "--no-hostonly-default-device", dracut only
adds the dump target as host devices, which naturally guarantees
only required dracut modules being selected.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Xunlei Pang 2017-08-30 16:45:42 +08:00 committed by Dave Young
parent 2c9128a971
commit dcffd4759e

View File

@ -359,44 +359,16 @@ check_crypt()
return 1
}
is_dm()
{
if [ -d "/sys/dev/block/$1/dm" ]; then
return 0
fi
return 1
}
crypt_exists=0
omit_dracut_modules()
{
local target majmin
local dm_exists
# Skip fadump case
is_fadump_capable && return
dm_exists=0
for target in $(get_kdump_targets); do
if [ -b "$target" ]; then
majmin=$(get_maj_min $target)
# Check "dm"
check_block_and_slaves is_dm $majmin && dm_exists=1
fi
done
# Omit "crypt", BZ1451717
if [ "$crypt_exists" == "0" ]; then
add_dracut_arg "--omit" "crypt"
fi
# Further omit more modules in case of no dm related target
if [ "$dm_exists" == "0" ]; then
# "dm_exists=0" implies "crypt_exists=0"
add_dracut_arg "--omit" "lvm dm multipath dmraid"
fi
}
if ! check_resettable; then