]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
lvm: do not run pvscan for lvmetad update
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 25 Nov 2013 13:38:00 +0000 (14:38 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 3 Dec 2013 15:20:25 +0000 (16:20 +0100)
The lvmetad daemon is not yet running in initramfs so there's no
need to run pvscan (or instantiate any lvm2-pvscan systemd service).
If pvscan was called in this case (either directly or via systemd
instantiated service), it would fail because there's no lvmetad
daemon to update. This could cause confusion, especially in systemd
instantiated service which is run only once!

modules.d/90lvm/module-setup.sh

index 87374da0b4520cfd98f3193567e1a60e8bc0b591..a220a5599e756a0e26b568bab7de246d67b9cf09 100755 (executable)
@@ -76,6 +76,16 @@ install() {
     fi
 
     inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
+
+    # Do not run lvmetad update via pvscan in udev rule  - lvmetad is not running yet in dracut!
+    if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
+        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
+        sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
+        sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
+    else
+        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
+    fi
+
     # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
     # files, but provides the one below:
     inst_rules 64-device-mapper.rules