Revert "mkdumprd: omit crypt when there is no crypt kdump target"

This reverts commit 54a5bcc4ee.

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:43 +08:00 committed by Dave Young
parent dcffd4759e
commit 8250f23c10
3 changed files with 12 additions and 27 deletions

View File

@ -6,7 +6,6 @@
DEFAULT_PATH="/var/crash/" DEFAULT_PATH="/var/crash/"
FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send" FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
perror_exit() { perror_exit() {
echo $@ >&2 echo $@ >&2
@ -482,14 +481,3 @@ get_dracut_args_target()
{ {
echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1 echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1
} }
is_fadump_capable()
{
# Check if firmware-assisted dump is enabled
# if no, fallback to kdump check
if [ -f $FADUMP_ENABLED_SYS_NODE ]; then
rc=`cat $FADUMP_ENABLED_SYS_NODE`
[ $rc -eq 1 ] && return 0
fi
return 1
}

View File

@ -13,6 +13,7 @@ DUMP_TARGET=""
DEFAULT_INITRD="" DEFAULT_INITRD=""
DEFAULT_INITRD_BAK="" DEFAULT_INITRD_BAK=""
TARGET_INITRD="" TARGET_INITRD=""
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered" FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered"
#kdump shall be the default dump mode #kdump shall be the default dump mode
DEFAULT_DUMP_MODE="kdump" DEFAULT_DUMP_MODE="kdump"
@ -935,6 +936,17 @@ handle_mode_switch()
fi fi
} }
is_fadump_capable()
{
# Check if firmware-assisted dump is enabled
# if no, fallback to kdump check
if [ -f $FADUMP_ENABLED_SYS_NODE ]; then
rc=`cat $FADUMP_ENABLED_SYS_NODE`
[ $rc -eq 1 ] && return 0
fi
return 1
}
check_current_fadump_status() check_current_fadump_status()
{ {
# Check if firmware-assisted dump has been registered. # Check if firmware-assisted dump has been registered.

View File

@ -359,24 +359,11 @@ check_crypt()
return 1 return 1
} }
crypt_exists=0
omit_dracut_modules()
{
# Skip fadump case
is_fadump_capable && return
# Omit "crypt", BZ1451717
if [ "$crypt_exists" == "0" ]; then
add_dracut_arg "--omit" "crypt"
fi
}
if ! check_resettable; then if ! check_resettable; then
exit 1 exit 1
fi fi
if ! check_crypt; then if ! check_crypt; then
crypt_exists=1
echo "Warning: Encrypted device is in dump path. User will prompted for password during second kernel boot." echo "Warning: Encrypted device is in dump path. User will prompted for password during second kernel boot."
fi fi
@ -461,8 +448,6 @@ then
add_dracut_arg "--add-drivers" "$extra_modules" add_dracut_arg "--add-drivers" "$extra_modules"
fi fi
omit_dracut_modules
dracut "${dracut_args[@]}" "$@" dracut "${dracut_args[@]}" "$@"
_rc=$? _rc=$?
sync sync