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

18971c
From 915618bc4fbbc631bf7661506b85fc5758f3ce26 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Thu, 3 Apr 2014 08:54:27 +0200
18971c
Subject: [PATCH] lvm:module-setup.sh: check for existance of
18971c
 69-dm-lvm-metad.rules
18971c
18971c
Before modifying 69-dm-lvm-metad.rules, we should check for the
18971c
existance first. Otherwise this results in error messages on
18971c
distributions (debian), which do not ship these rules.
18971c
18971c
(cherry picked from commit 12819a579900b9691e2bfaf14e76fbb025851530)
18971c
---
18971c
 modules.d/90lvm/module-setup.sh | 3 ++-
18971c
 1 file changed, 2 insertions(+), 1 deletion(-)
18971c
18971c
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
18971c
index 1c962d54..4a49fc7d 100755
18971c
--- a/modules.d/90lvm/module-setup.sh
18971c
+++ b/modules.d/90lvm/module-setup.sh
18971c
@@ -78,7 +78,8 @@ install() {
18971c
     inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
18971c
 
18971c
     # Do not run lvmetad update via pvscan in udev rule  - lvmetad is not running yet in dracut!
18971c
-    if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
18971c
+    if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]] && \
18971c
+        grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
18971c
         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
18971c
         sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
18971c
         sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules