2009-10-27 01:42:07 +03:00
# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
2009-08-03 22:44:54 +04:00
# 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.
2009-10-22 17:11:33 +04:00
# "add" event is processed on coldplug only!
2009-11-13 15:33:27 +03:00
ACTION!="add|change", GOTO="dm_end"
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end"
2009-08-03 22:44:54 +04:00
SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
2009-11-13 15:33:27 +03:00
ENV{DM_SUSPENDED}=="1", GOTO="dm_end"
2009-08-03 22:44:54 +04:00
2012-02-20 23:38:40 +04:00
(BLKID_RULE)
2009-10-22 17:11:33 +04:00
ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100"
2009-08-03 22:44:54 +04:00
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}"
2012-02-15 18:50:33 +04:00
# Add inotify watch to track changes on this device.
2012-02-15 19:10:31 +04:00
# Using the watch rule is not optimal - it generates a lot of spurious
2012-02-15 18:50:33 +04:00
# and useless events whenever the device opened for read-write is closed.
# The best would be to generete the event directly in the tool changing
# relevant information so only relevant events will be processed
# (like creating a filesystem, changing filesystem label etc.).
#
# But let's use this until we have something better...
OPTIONS+="watch"
2009-08-03 22:44:54 +04:00
LABEL="dm_end"