Since the current dracut of Fedora already supports not always
mount the root device, we can remove "root=X" from the command
line directly, and always get the dump target specified in
"/etc/kdump.conf" and mount it. If the dump target is located
at root filesystem, we will add the root mount info explicitly
from kdump side instead of from dracut side.
We will have only one device mounted in kdump after this patch.
For example, in case of nfs/ssh/usb/etc(non-root) dumping, kdump
will not mount the unnecessary root filesystem after this change.
This patch removes "root=X" via "KDUMP_COMMANDLINE_REMOVE" feature,
mount the non-root target under "/kdumproot", and the root target
still under "/sysroot".
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 2 +-
mkdumprd | 29 ++++++++++-------------------
2 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index b9ff268..09901fd 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -188,7 +188,7 @@ prepare_cmdline()
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 root`
# These params can be removed configurably
cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
diff --git a/mkdumprd b/mkdumprd
index f30d9c2..892e59a 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -80,12 +80,6 @@ add_dracut_sshkey() {
add_dracut_arg "--sshkey" "$1"
}
-target_is_root() {
- local _t
- _t=$(findmnt -k -n -r -o TARGET $1|sort|head -1)
- [ "$_t" = "/" ]
-}
-
# caller should ensure $1 is valid and mounted in 1st kernel
to_mount() {
local _dev=$1 _source _target _fstype _options _mntopts _pdev
@@ -247,13 +241,13 @@ verify_core_collector() {
}
add_mount() {
- if ! target_is_root "$1"; then
- local _mnt=$(to_mount "$1")
- if [ $? -ne 0 ]; then
- exit 1
- fi
- add_dracut_mount "$_mnt"
+ local _mnt=$(to_mount "$1")
+
+ if [ $? -ne 0 ]; then
+ exit 1
fi
+
+ add_dracut_mount "$_mnt"
}
get_block_dump_target()
@@ -293,13 +287,10 @@ handle_default_dump_target()
SAVE_PATH=$_mntpoint/$SAVE_PATH
fi
- if [ "$_mntpoint" != "/" ]; then
- SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
- _fstype=$(get_fs_type_from_target $_target)
-
- add_mount "$_target"
- check_size fs $_target
- fi
+ SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
+ _fstype=$(get_fs_type_from_target $_target)
+ add_mount "$_target"
+ check_size fs $_target
}
get_default_action_target()
--
1.8.3.1