From e067d77dfc4581e3126ebdb8b297088be9d59fb6 Mon Sep 17 00:00:00 2001 From: Xunlei Pang Date: Wed, 30 Aug 2017 16:45:47 +0800 Subject: [PATCH] mkdumprd: apply dracut "--hostonly-cmdline" and "--no-hostonly-default-device" 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. Signed-off-by: Xunlei Pang Acked-by: Dave Young --- kdump-lib.sh | 8 -------- kexec-tools.spec | 2 +- mkdumprd | 4 +++- 3 files changed, 4 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 5342dac..6df144b 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() { @@ -452,6 +452,8 @@ if ! is_fadump_capable; then # The 2nd rootfs mount stays behind the normal dump target mount, # so it doesn't affect the logic of check_dump_fs_modified(). is_dump_to_rootfs && add_mount "$(to_dev_name $(get_root_fs_device))" + + add_dracut_arg "--no-hostonly-default-device" fi dracut "${dracut_args[@]}" "$@"