On 08/30/2017 at 10:12 AM, Xunlei Pang wrote:
Now dracut supports "--no-hostonly-default-device" which enables us to only add the kdump target, which can avoid needless devices being recognized under kdump.
Signed-off-by: Xunlei Pang xlpang@redhat.com
For better understanding, here is the improved changelog: Dracut has "--hostonly-cmdline" which can generate cmdlines(if any) regarding the dump target, it's an existing way for us to use to simplify the code. E.g. We already removed generate_lvm_cmdlines(), to use "--hostonly-cmdline".
But "--hostonly-cmdline" has other issues(e.g. BZ1451717), it adds needless devices for kdump like root device.
Now dracut supports "--no-hostonly-default-device" which enables us to only add the kdump target, which can avoid needless devices being recognized under kdump. Thus "--hostonly-cmdline" side effects can be avoided with the help of "--no-hostonly-default-device".
This patch applies dracut's "--hostonly-cmdline" together with "--no-hostonly-default-device" to achieve above-mentioned purpose.
Note that "--no-hostonly-default-device" feature was merged in "dracut-046-7.git20170824.fc28".
kdump-lib.sh | 8 -------- kexec-tools.spec | 2 +- mkdumprd | 10 +++++++++- 3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh index 19d749f..d981c4f 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -186,14 +186,6 @@ get_kdump_targets() kdump_targets="$kdump_targets $_root" fi
- # NOTE:
- # dracut parses devices from "/etc/fstab" with the "x-initrd.mount" option,
- # which will be added as host_devs, it also includes usually simple devices
- # (say mounted to /boot, /boot/efi/, etc) plus the root device. Then kdump
- # must wait for these devices if initramfs is built with "--hostonly-cmdline".
- #
- # We don't pass "--hostonly-cmdline" to dracut, so there's no problem.
- echo "$kdump_targets"
}
diff --git a/kexec-tools.spec b/kexec-tools.spec index 1a37ef9..f356e32 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -47,7 +47,7 @@ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units Requires(pre): coreutils sed zlib -Requires: dracut >= 044-117 +Requires: dracut >= 046-7 Requires: dracut-network >= 044-117 Requires: ethtool BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel diff --git a/mkdumprd b/mkdumprd index 9f375e0..37aaf9f 100644 --- a/mkdumprd +++ b/mkdumprd @@ -37,7 +37,7 @@ is_wdt_addition_needed [[ $? -eq 0 ]] && WDTCFG="-a watchdog"
extra_modules="" -dracut_args=("--hostonly" "--hostonly-i18n" "-o" "plymouth dash resume ifcfg" $WDTCFG) +dracut_args=("--hostonly" "--hostonly-cmdline" "--hostonly-i18n" "-o" "plymouth dash resume ifcfg" $WDTCFG) OVERRIDE_RESETTABLE=0
add_dracut_arg() { @@ -448,6 +448,14 @@ then add_dracut_arg "--add-drivers" "$extra_modules" fi
+if ! is_fadump_capable; then
- add_dracut_arg "--no-hostonly-default-device"
- if is_dump_to_rootfs; then
add_dracut_arg "--add-device" "$(to_dev_name $(get_root_fs_device))"- fi
+fi
dracut "${dracut_args[@]}" "$@" _rc=$? sync