Blame SOURCES/0447-lvm-include-etc-lvm-lvm_-host_tag-.conf.patch

18971c
From 20171c75197c799d4710d04a0d6d1f73c510213b Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 22 Jul 2016 13:26:10 +0200
18971c
Subject: [PATCH] lvm: include /etc/lvm/lvm_<host_tag>.conf
18971c
18971c
https://bugzilla.redhat.com/show_bug.cgi?id=1328778
18971c
---
18971c
 modules.d/90lvm/module-setup.sh | 17 ++++++++++-------
18971c
 1 file changed, 10 insertions(+), 7 deletions(-)
18971c
18971c
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
18971c
index 5e374fbc..23d63a04 100755
18971c
--- a/modules.d/90lvm/module-setup.sh
18971c
+++ b/modules.d/90lvm/module-setup.sh
18971c
@@ -60,13 +60,16 @@ install() {
18971c
     inst_rules "$moddir/64-lvm.rules"
18971c
 
18971c
     if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
18971c
-        if [ -f /etc/lvm/lvm.conf ]; then
18971c
-            inst_simple /etc/lvm/lvm.conf
18971c
-            # FIXME: near-term hack to establish read-only locking;
18971c
-            # use command-line lvm.conf editor once it is available
18971c
-            sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
18971c
-            sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
18971c
-        fi
18971c
+        for f in /etc/lvm/lvm.conf /etc/lvm/lvm_*.conf; do
18971c
+            [ -e "$f" ] || continue
18971c
+            inst_simple "$f"
18971c
+            if [ -f "${initdir}/$f" ]; then
18971c
+                # FIXME: near-term hack to establish read-only locking;
18971c
+                # use command-line lvm.conf editor once it is available
18971c
+                sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' "${initdir}/$f"
18971c
+                sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' "${initdir}/$f"
18971c
+            fi
18971c
+        done
18971c
     fi
18971c
 
18971c
     if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then