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

a56a5e
From 915618bc4fbbc631bf7661506b85fc5758f3ce26 Mon Sep 17 00:00:00 2001
a56a5e
From: Harald Hoyer <harald@redhat.com>
a56a5e
Date: Thu, 3 Apr 2014 08:54:27 +0200
a56a5e
Subject: [PATCH] lvm:module-setup.sh: check for existance of
a56a5e
 69-dm-lvm-metad.rules
a56a5e
a56a5e
Before modifying 69-dm-lvm-metad.rules, we should check for the
a56a5e
existance first. Otherwise this results in error messages on
a56a5e
distributions (debian), which do not ship these rules.
a56a5e
a56a5e
(cherry picked from commit 12819a579900b9691e2bfaf14e76fbb025851530)
a56a5e
---
a56a5e
 modules.d/90lvm/module-setup.sh | 3 ++-
a56a5e
 1 file changed, 2 insertions(+), 1 deletion(-)
a56a5e
a56a5e
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
a56a5e
index 1c962d5..4a49fc7 100755
a56a5e
--- a/modules.d/90lvm/module-setup.sh
a56a5e
+++ b/modules.d/90lvm/module-setup.sh
a56a5e
@@ -78,7 +78,8 @@ 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 grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
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