Blame 0032-lvm-do-not-run-pvscan-for-lvmetad-update.patch

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