mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Detect the lvm binary path in lvmetad udev rules.
We can't use 'DM_SBIN_PATH'. This one is set only for DM devices but not for all block devices - the pvscan is run on all relevant block devices! This LVM_SBIN_PATH (as well as DM_SBIN_PATH) detection should be removed eventually but for upstream solution, we still have to do that as there are known cases where the binaries are put either in /sbin or /usr/sbin (some installation systems, initrd systems etc.).
This commit is contained in:
parent
166393a6dd
commit
c1ce99cd81
@ -19,7 +19,12 @@ SUBSYSTEM!="block", GOTO="lvm_end"
|
|||||||
# Device-mapper devices are processed only on change event or on supported synthesized event.
|
# 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"
|
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.
|
# 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"
|
LABEL="lvm_end"
|
||||||
|
Loading…
Reference in New Issue
Block a user