Currently, we kept "root=X" for the dump_to_rootfs case, this
patch consolidates to use "--mount" for all the kdump mounts.
One advantage of this way is that dracut can correctly mark root
(in case of dump_to_rootfs is specified) as the host device when
"--no-hostonly-default-device" is added in the following patch.
Changed the code style in passing, as shellcheck tool reported:
Use $(..) instead of deprecated `..`
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 17 +++++++----------
mkdumprd | 6 ++++++
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 4c11bc9..114a09d 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -181,32 +181,29 @@ prepare_cmdline()
local cmdline id
if [ -z "$KDUMP_COMMANDLINE" ]; then
- cmdline=`cat /proc/cmdline`
+ cmdline=$(cat /proc/cmdline)
else
cmdline=${KDUMP_COMMANDLINE}
fi
# These params should always be removed
- cmdline=`remove_cmdline_param "$cmdline" crashkernel panic_on_warn`
+ cmdline=$(remove_cmdline_param "$cmdline" crashkernel panic_on_warn)
# These params can be removed configurably
- cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
+ cmdline=$(remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE})
# Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we can
- # not remove it in case of fadump or "default dump_to_rootfs".
+ # of dump target mount information including root fs.
#
# We do this before KDUMP_COMMANDLINE_APPEND, if one really cares
# about it(e.g. for debug purpose), then can pass "root=X" using
# KDUMP_COMMANDLINE_APPEND.
- if [ $DEFAULT_DUMP_MODE != "fadump" ] && ! is_dump_to_rootfs; then
- cmdline=`remove_cmdline_param "$cmdline" root`
- fi
+ cmdline=$(remove_cmdline_param "$cmdline" root)
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
- id=`get_bootcpu_apicid`
+ id=$(get_bootcpu_apicid)
if [ ! -z ${id} ] ; then
- cmdline=`append_cmdline "${cmdline}" disable_cpu_apicid ${id}`
+ cmdline=$(append_cmdline "${cmdline}" disable_cpu_apicid ${id})
fi
KDUMP_COMMANDLINE=$cmdline
diff --git a/mkdumprd b/mkdumprd
index 9f375e0..5342dac 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -448,6 +448,12 @@ then
add_dracut_arg "--add-drivers" "$extra_modules"
fi
+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))"
+fi
+
dracut "${dracut_args[@]}" "$@"
_rc=$?
sync
--
1.8.3.1