On 11/11/16 at 11:30am, Dave Young wrote:
We maintained kdump specific get persistent dev function, it is ready to drop it.
Dracut upstream splitted dracut init stuff from dracut-functions.sh so that we
can source it.
OTOH, dracut now has a persistent_policy feature, for kdump when we dump to
raw disks we do not care the filesystem uuid and labels so we prefer to search
disk id instead. Set the persistent_policy before calling get_persistent_dev will
ensure kdump logic still works.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
kdump-lib.sh | 26 --------------------------
kdumpctl | 8 +++++++-
mkdumprd | 10 ++++++----
3 files changed, 13 insertions(+), 31 deletions(-)
--- kexec-tools.orig/kdump-lib.sh
+++ kexec-tools/kdump-lib.sh
@@ -88,32 +88,6 @@ to_dev_name() {
echo $dev
}
-kdump_get_persistent_dev() {
- local i _tmp _dev _lookup_dirs
-
- _dev=$(udevadm info --query=name --name="$1" 2>/dev/null)
- [ -z "$_dev" ] && {
- perror_exit "Kernel dev name of $1 is not found."
- }
-
- if [[ $2 = "raw" ]];then
- _lookup_dirs="/dev/mapper/* /dev/disk/by-id/*"
- else
- _lookup_dirs="/dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*"
- fi
-
- for i in $_lookup_dirs; do
- _tmp=$(udevadm info --query=name --name="$i" 2>/dev/null)
- if [ "$_tmp" = "$_dev" ]; then
- echo $i
- return
- fi
- done
-
- perror "WARNING: Persistent device name of $1 not found. Using $1 as dump
target name"
- echo $1
-}
-
get_user_configured_dump_disk()
{
local _target
--- kexec-tools.orig/kdumpctl
+++ kexec-tools/kdumpctl
@@ -16,6 +16,8 @@ FADUMP_REGISTER_SYS_NODE="/sys/kernel/fa
DEFAULT_DUMP_MODE="kdump"
image_time=0
+[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
+. $dracutbasedir/dracut-functions.sh
. /lib/kdump/kdump-lib.sh
standard_kexec_args="-p"
@@ -416,7 +418,11 @@ check_dump_fs_modified()
if [[ $(expr substr $_new_fstype 1 3) = "nfs" ]];then
_new_dev=$_target
else
- _new_dev=$(kdump_get_persistent_dev $_target $_new_fstype)
+ _new_dev=$(persistent_policy="by-id" get_persistent_dev $_target)
Will resend the patch, ^^^ should not set "by-id", only raw disk need it.
Thanks
Dave