]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(multipath): get config. dir from configuration
authorDavid Tardon <dtardon@redhat.com>
Tue, 1 Jun 2021 13:06:01 +0000 (15:06 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 28 Jun 2021 11:21:33 +0000 (13:21 +0200)
modules.d/90multipath/module-setup.sh

index b6002c6a3c9c160de492ba82cf14884b50a1801c..05222389e21e82834b587349ec82afc3f4e43c62 100755 (executable)
@@ -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