From 3b09c4910d45c020d27b944e2e6a74c98880f7c1 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Wed, 11 Mar 2020 01:21:30 +0800 Subject: [PATCH] Remove adjust_bind_mount_path call If user configured target is used, path should be used as the absolute path within the dump target direct, and user should be fully aware of the path structure within the target device. The adjust_bind_mount_path call here make it very hard to control the behavior. Especially, if it's a cross device bind mount, this will likely create a invalid path in the target. And for atomic case, adjust_bind_mount_path call here assumes user will always pass root device as the explicitly configured dump target, which is not true. If user configured target device is used, the path is always be the absolute path inside of given target. If user don't know about the path structure in the target device, then user should either use the path based config, or carefully exam the target device before using it as a dump target. Signed-off-by: Kairui Song Acked-by: Lianbo Jiang --- dracut-module-setup.sh | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 0f6f1cb..fdef509 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -452,18 +452,6 @@ default_dump_target_install_conf() echo "path $_save_path" >> ${initdir}/tmp/$$-kdump.conf } -adjust_bind_mount_path() -{ - local _save_path=$(get_save_path) - local _mntpoint=$(get_mntpoint_from_target $1) - local _absolute_save_path=$(get_bind_mount_source $_mntpoint$_save_path) - - if [ $_absolute_save_path != $_save_path ]; then - sed -i "/^path/d" ${initdir}/tmp/$$-kdump.conf - echo "path $_absolute_save_path" >> ${initdir}/tmp/$$-kdump.conf - fi -} - #install kdump.conf and what user specifies in kdump.conf kdump_install_conf() { local _opt _val _pdev @@ -480,7 +468,6 @@ kdump_install_conf() { ext[234]|xfs|btrfs|minix) _pdev=$(kdump_get_persistent_dev $_val) sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf - adjust_bind_mount_path "$_val" ;; ssh|nfs) kdump_install_net "$_val"