mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
f83332a0d5
- add DM_UDEV_RULES_VSN to provide a variable to be checked for in the other rules (e.g. to check that DM rules are actually installed, we can alternate functionality in the other rules based on this information, also we have versioning support for the rules) - set proper sbin path for dmsetup and blkid, /sbin first, then /usr/sbin. This is necessary for anaconda to work properly. - add 'last_rule' for cryptsetup's temporary devices (symlinks in /dev/mapper only)
33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
# Udev rules for LVM.
|
|
#
|
|
# These rules create symlinks for LVM logical volumes in
|
|
# /dev/VG directory (VG is an actual VG name). Some udev
|
|
# environment variables are set (they can be used in later
|
|
# rules as well):
|
|
# DM_LV_NAME - logical volume name
|
|
# DM_VG_NAME - volume group name
|
|
# DM_LV_LAYER - logical volume layer (blank if not set)
|
|
|
|
SUBSYSTEM!="block", GOTO="lvm_end"
|
|
KERNEL!="dm-[0-9]*", GOTO="lvm_end"
|
|
ACTION!="add|change", GOTO="lvm_end"
|
|
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end"
|
|
ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"
|
|
|
|
# Normally, we operate on "change" events only. But when
|
|
# coldplugging, there's an "add" event present. We have
|
|
# to recognize this and do our actions in this particular
|
|
# situation, too.
|
|
ACTION=="add", ENV{STARTUP}!="1", GOTO="lvm_end"
|
|
|
|
# Use DM name and split it up into its VG/LV/layer constituents.
|
|
IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}"
|
|
|
|
# Do not create symlinks for hidden subdevices.
|
|
ENV{DM_LV_NAME}=="?*_mimage_[0-9]*|pvmove?*|?*_vorigin", GOTO="lvm_end"
|
|
|
|
# Create symlinks for top-level devices only.
|
|
ENV{DM_VG_NAME}=="?*", ENV{DM_LV_NAME}=="?*", ENV{DM_LV_LAYER}!="?*", SYMLINK+="$env{DM_VG_NAME}/$env{DM_LV_NAME}"
|
|
|
|
LABEL="lvm_end"
|