File kdump-always-create-multipath.conf.patch of Package kdump

From: Petr Tesarik <ptesarik@suse.com>
Date: Tue Oct 6 14:24:14 2015 +0200
Subject: Always create a multipath.conf in kdumprd
References: bsc#948956
Patch-mainline: v0.8.16
Git-commit: 8abf0489c7c647c9b44599e6960e8c1ab0d9f8b6

The configuration file may be missing even if multipath is in use,
but kdump should always create a multipath.conf file that blacklist
all devices except those needed to save the dump (even if none).

Signed-off-by: Petr Tesarik <ptesarik@suse.com>

---
 init/setup-kdump.functions |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/init/setup-kdump.functions
+++ b/init/setup-kdump.functions
@@ -638,8 +638,10 @@ function kdump_modify_multipath()
 {
     local -a wwids
     eval wwids="($1)"
+    local conf="/etc/multipath.conf"
+    test -e "$conf" || conf="/dev/null"
     kdumptool multipath "${wwids[@]}" \
-	< /etc/multipath.conf
+	< "$conf"
 }									   # }}}
 
 #
@@ -751,9 +753,7 @@ function kdump_setup_files()						   # {
     #
     # create modified multipath.conf
     #
-    if [ -e /etc/multipath.conf ] ; then
-	kdump_modify_multipath "$mpathdevs" > "${outdir}/etc/multipath.conf"
-    fi
+    kdump_modify_multipath "$mpathdevs" > "${outdir}/etc/multipath.conf"
 
     return 0
 }									   # }}}
openSUSE Build Service is sponsored by