mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +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)
31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
# Udev rules for device-mapper devices.
|
|
#
|
|
# These rules create symlinks in /dev/disk directory.
|
|
# Symlinks that depend on probing filesystem type,
|
|
# label and uuid are created only if the device is not
|
|
# suspended.
|
|
|
|
SUBSYSTEM!="block", GOTO="dm_end"
|
|
KERNEL!="dm-[0-9]*", GOTO="dm_end"
|
|
ACTION!="add|change", GOTO="dm_end"
|
|
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_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="dm_end"
|
|
|
|
SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
|
|
ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
|
|
|
|
ENV{DM_SUSPENDED}=="1", GOTO="dm_end"
|
|
|
|
IMPORT{program}="$env{DM_SBIN_PATH}/blkid -o udev -p $tempnode"
|
|
OPTIONS="link_priority=-100"
|
|
ENV{DM_LV_LAYER}=="?*", OPTIONS="link_priority=-90"
|
|
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
|
|
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
|
|
|
|
LABEL="dm_end"
|