Blob Blame History Raw
From edce5bac8f65cee78fcf6c960ffb4e5924f81f78 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 1 Jun 2021 15:06:01 +0200
Subject: [PATCH] fix(multipath): get config. dir from configuration

(cherry picked from commit 2e3c5444d271cb8f05955858b8fdc367c4ea5c48)

Resolves: #1992464
---
 modules.d/90multipath/module-setup.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index b6002c6a..05222389 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -63,6 +63,7 @@ installkernel() {
 # called by dracut
 install() {
     local -A _allow
+    local config_dir
 
     add_hostonly_mpath_conf() {
         if is_mpath "$1"; then
@@ -74,6 +75,16 @@ install() {
         fi
     }
 
+    local k v
+    while read -r k v; do
+        if [[ $k == "config_dir" ]]; then
+            v="${v#\"}"
+            config_dir="${v%\"}"
+            break
+        fi
+    done < <(multipath -t 2> /dev/null)
+    [[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d
+
     inst_multiple \
         pkill \
         pidof \
@@ -91,7 +102,7 @@ install() {
         /etc/xdrdevices.conf \
         /etc/multipath.conf \
         /etc/multipath/* \
-        /etc/multipath/conf.d/*
+        "$config_dir"/*
 
     [[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
         for_each_host_dev_and_slaves_all add_hostonly_mpath_conf