Blame SOURCES/0194-lvm-module-setup.sh-check-for-existance-of-69-dm-lvm.patch

a56a5e
From 0c81abbe79938423d41093b620175d97b435feb5 Mon Sep 17 00:00:00 2001
a56a5e
From: Harald Hoyer <harald@redhat.com>
a56a5e
Date: Thu, 3 Jul 2014 15:04:17 +0200
a56a5e
Subject: [PATCH] lvm:module-setup.sh: check for existance of
a56a5e
 69-dm-lvm-metad.rules
a56a5e
a56a5e
fixup for 12819a579900b9691e2bfaf14e76fbb025851530
a56a5e
a56a5e
(cherry picked from commit fecc1d69e5a12c305d93e7dca64bd690a1fe8ff5)
a56a5e
---
a56a5e
 modules.d/90lvm/module-setup.sh | 17 ++++++++++-------
a56a5e
 1 file changed, 10 insertions(+), 7 deletions(-)
a56a5e
a56a5e
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
a56a5e
index 4a49fc7..0c5890a 100755
a56a5e
--- a/modules.d/90lvm/module-setup.sh
a56a5e
+++ b/modules.d/90lvm/module-setup.sh
a56a5e
@@ -78,13 +78,16 @@ install() {
a56a5e
     inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
a56a5e
 
a56a5e
     # Do not run lvmetad update via pvscan in udev rule  - lvmetad is not running yet in dracut!
a56a5e
-    if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]] && \
a56a5e
-        grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
a56a5e
-        sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
-        sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
-        sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
-    else
a56a5e
-        sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
+    if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]]; then
a56a5e
+        if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
a56a5e
+            sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' \
a56a5e
+                ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
+            sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
+            sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
+        else
a56a5e
+            sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \
a56a5e
+                ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
a56a5e
+        fi
a56a5e
     fi
a56a5e
 
a56a5e
     # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules