lvm2/lvm2-2_02_96-detect-lvm-binary-path-in-lvmetad-udev-rules.patch

22 lines
1.0 KiB
Diff

udev/69-dm-lvm-metad.rules | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/udev/69-dm-lvm-metad.rules b/udev/69-dm-lvm-metad.rules
index d6e4169..d272e6e 100644
--- a/udev/69-dm-lvm-metad.rules
+++ b/udev/69-dm-lvm-metad.rules
@@ -19,7 +19,12 @@ SUBSYSTEM!="block", GOTO="lvm_end"
# Device-mapper devices are processed only on change event or on supported synthesized event.
KERNEL=="dm-[0-9]*", ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end"
+# Set proper sbin path, /sbin has higher priority than /usr/sbin.
+ENV{LVM_SBIN_PATH}="/sbin"
+TEST!="$env{LVM_SBIN_PATH}/lvm", ENV{LVM_SBIN_PATH}="/usr/sbin"
+TEST!="$env{LVM_SBIN_PATH}/lvm", GOTO="lvm_end"
+
# Only process devices already marked as a PV - this requires blkid to be called before.
-ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", RUN+="$env{DM_SBIN_PATH}/pvscan --cache --major $major --minor $minor"
+ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", RUN+="$env{LVM_SBIN_PATH}/lvm pvscan --cache --major $major --minor $minor"
LABEL="lvm_end"