f226d6
From edce5bac8f65cee78fcf6c960ffb4e5924f81f78 Mon Sep 17 00:00:00 2001
f226d6
From: David Tardon <dtardon@redhat.com>
f226d6
Date: Tue, 1 Jun 2021 15:06:01 +0200
f226d6
Subject: [PATCH] fix(multipath): get config. dir from configuration
f226d6
f226d6
(cherry picked from commit 2e3c5444d271cb8f05955858b8fdc367c4ea5c48)
f226d6
f226d6
Resolves: #1992464
f226d6
---
f226d6
 modules.d/90multipath/module-setup.sh | 13 ++++++++++++-
f226d6
 1 file changed, 12 insertions(+), 1 deletion(-)
f226d6
f226d6
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
f226d6
index b6002c6a..05222389 100755
f226d6
--- a/modules.d/90multipath/module-setup.sh
f226d6
+++ b/modules.d/90multipath/module-setup.sh
f226d6
@@ -63,6 +63,7 @@ installkernel() {
f226d6
 # called by dracut
f226d6
 install() {
f226d6
     local -A _allow
f226d6
+    local config_dir
f226d6
 
f226d6
     add_hostonly_mpath_conf() {
f226d6
         if is_mpath "$1"; then
f226d6
@@ -74,6 +75,16 @@ install() {
f226d6
         fi
f226d6
     }
f226d6
 
f226d6
+    local k v
f226d6
+    while read -r k v; do
f226d6
+        if [[ $k == "config_dir" ]]; then
f226d6
+            v="${v#\"}"
f226d6
+            config_dir="${v%\"}"
f226d6
+            break
f226d6
+        fi
f226d6
+    done < <(multipath -t 2> /dev/null)
f226d6
+    [[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d
f226d6
+
f226d6
     inst_multiple \
f226d6
         pkill \
f226d6
         pidof \
f226d6
@@ -91,7 +102,7 @@ install() {
f226d6
         /etc/xdrdevices.conf \
f226d6
         /etc/multipath.conf \
f226d6
         /etc/multipath/* \
f226d6
-        /etc/multipath/conf.d/*
f226d6
+        "$config_dir"/*
f226d6
 
f226d6
     [[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
f226d6
         for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
f226d6