[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH mkinitrd] Use location of bindings file from multipath.conf (#593050)



Copy the bindings file from the location in the multipath.conf file, or
copy from /var/lib/multipath/bindings

Resolves: rhbz#593050
---
 mkinitrd |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/mkinitrd b/mkinitrd
index 5a4ad2e..cd98ba0 100755
--- a/mkinitrd
+++ b/mkinitrd
@@ -1606,9 +1606,17 @@ if [ "$use_multipath" == "1" ]; then
     if [ -f /etc/multipath.conf ]; then
         inst /etc/multipath.conf $MNTIMAGE/etc/multipath.conf
     fi
-    if [ -f /var/lib/multipath/bindings ]; then
-        inst /var/lib/multipath/bindings $MNTIMAGE/var/lib/multipath/bindings
+
+    if [ -f /etc/multipath.conf ]; then
+        if [ "$(egrep '^[[:space:]]*user_friendly_names[[:space:]]+yes' /etc/multipath.conf)" ] ;  then
+            bindings=$(awk '/^[[:blank:]]*bindings_file[[:blank:]]/ { gsub(/"/,""); print $2 }'  /etc/multipath.conf)
+        fi
     fi
+    bindings=${bindings:-/var/lib/multipath/bindings}
+    if [ -f $bindings ]; then
+        inst $bindings $MNTIMAGE/$bindings
+    fi
+
     inst /sbin/scsi_id $MNTIMAGE/bin/scsi_id
     inst /etc/scsi_id.config $MNTIMAGE/etc/scsi_id.config
     # This includes all mpath_prio checkers in the image (~2.5M)
-- 
1.6.6.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]