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

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