Blame SOURCES/0043-lvm-do-not-run-pvscan-for-lvmetad-update.patch

a56a5e
From 05b79aaa9dde30d4f179303a81084b59898406b6 Mon Sep 17 00:00:00 2001
966cef
From: Peter Rajnoha <prajnoha@redhat.com>
966cef
Date: Mon, 25 Nov 2013 14:38:00 +0100
966cef
Subject: [PATCH] lvm: do not run pvscan for lvmetad update
966cef
966cef
The lvmetad daemon is not yet running in initramfs so there's no
966cef
need to run pvscan (or instantiate any lvm2-pvscan systemd service).
966cef
If pvscan was called in this case (either directly or via systemd
966cef
instantiated service), it would fail because there's no lvmetad
966cef
daemon to update. This could cause confusion, especially in systemd
966cef
instantiated service which is run only once!
966cef
---
966cef
 modules.d/90lvm/module-setup.sh | 10 ++++++++++
966cef
 1 file changed, 10 insertions(+)
966cef
966cef
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
1755ca
index f1c19a22..7e3d44fa 100755
966cef
--- a/modules.d/90lvm/module-setup.sh
966cef
+++ b/modules.d/90lvm/module-setup.sh
966cef
@@ -74,6 +74,16 @@ install() {
966cef
     fi
966cef
 
966cef
     inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
966cef
+
966cef
+    # Do not run lvmetad update via pvscan in udev rule  - lvmetad is not running yet in dracut!
966cef
+    if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
966cef
+        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
966cef
+        sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
966cef
+        sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
966cef
+    else
966cef
+        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
966cef
+    fi
966cef
+
966cef
     # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
966cef
     # files, but provides the one below:
966cef
     inst_rules 64-device-mapper.rules