mirror of
git://sourceware.org/git/lvm2.git
synced 2025-04-30 22:50:45 +03:00
- we have these levels when the udev rules are processed: 10-dm.rules --> [11-dm-<subsystem>.rules] --> [12-dm-permissions.rules] --> 13-dm-disk.rules --> [...all the other foreign rules...] --> 95-dm-notify.rules - each level can be disabled now by DM_UDEV_DISABLE_{DM, SUBSYSTEM, DISK, OTHER}_RULES_FLAG - add DM_UDEV_DISABLE_DM_RULES_FLAG to disable 10-dm.rules - add DM_UDEV_DISABLE_OTHER_RULES_FLAG to disable all the other (non-dm) rules. We cutoff these rules by using the 'last_rule', so this one should really be used with great care and in well-founded situations. We use this for lvm's hidden and layer devices now. - add a parameter for add_dev_node, rm_dev_node and rename_dev_node so it's possible to switch on/off udev checks - use DM_UDEV_DISABLE_DM_RULES_FLAG and DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG if there's no cookie set and we have resume, remove and rename ioctl. This could happen when someone uses the libdevmapper that is compiled with udev_sync but the software does not make use of it. This way we can switch off the rules and fallback to libdevmapper node creation so there's no udev/libdevmapper race.
33 lines
1.3 KiB
Plaintext
33 lines
1.3 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.
|
|
|
|
# "add" event is processed on coldplug only!
|
|
ACTION!="add|change", GOTO="dm_end"
|
|
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_other"
|
|
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_other"
|
|
|
|
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_other"
|
|
|
|
IMPORT{program}="$env{DM_SBIN_PATH}/blkid -o udev -p $tempnode"
|
|
ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100"
|
|
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}"
|
|
|
|
# Cutoff all subsequent rules if instructed by a flag.
|
|
# This flag should be used in well-founded situations only to prevent
|
|
# any problems that could arise when processing this event further by
|
|
# foreign rules (various temporary and hidden devices mostly).
|
|
LABEL="dm_other"
|
|
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="dm_end"
|
|
ENV{DM_COOKIE}=="?*", RUN+="$env{DM_SBIN_PATH}/dmsetup udevcomplete $env{DM_COOKIE}"
|
|
OPTIONS+="last_rule"
|
|
|
|
LABEL="dm_end"
|