Blame 0002-lvm-module-setup.sh-check-for-existance-of-69-dm-lvm.patch

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