summaryrefslogtreecommitdiffstats
path: root/udev/10-dm.rules.in
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2009-10-22 13:11:33 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2009-10-22 13:11:33 +0000
commit772f7d4188e5d2f99c03f217b91d35efb482ae42 (patch)
treedcec92b13a9141f6c5f84c676888eb50207bd026 /udev/10-dm.rules.in
parentf16aea9ebdb18ddd1220bd713794174792534d59 (diff)
downloadlvm2-772f7d4188e5d2f99c03f217b91d35efb482ae42.tar.gz
lvm2-772f7d4188e5d2f99c03f217b91d35efb482ae42.tar.xz
lvm2-772f7d4188e5d2f99c03f217b91d35efb482ae42.zip
Use udev flags in the rules and cleanup the rules:
- remove default permissions set in 95-dm-notify.rules (and add a hint in 12-dm-permissions.rules to set it by the user directly) - add multipath DM_ACTION=="PATH_FAILED" filter - remove unnecessary filters in the headers of the rules (we can simply use DM_UDEV_RULES_VSN instead) - fix symlink priorities in /dev/disk/ (snapshot volumes have low priority for FS UUID symlinks so it will not overwrite symlinks for the origin)
Diffstat (limited to 'udev/10-dm.rules.in')
-rw-r--r--udev/10-dm.rules.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index 1386b40a..211c0c31 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -20,6 +20,9 @@ ENV{DM_SBIN_PATH}="/sbin"
TEST!="$env{DM_SBIN_PATH}/dmsetup", ENV{DM_SBIN_PATH}="/usr/sbin"
TEST!="$env{DM_SBIN_PATH}/dmsetup", GOTO="dm_end"
+# Decode udev control flags and set environment variables appropriately.
+ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env{DM_COOKIE}"
+
ACTION!="add|change", GOTO="dm_end"
# Normally, we operate on "change" events only. But when
@@ -55,10 +58,11 @@ ENV{DM_SUSPENDED}=="Suspended", ENV{DM_SUSPENDED}="1"
# possible future changes.
ENV{DM_UDEV_RULES_VSN}="1"
-ENV{DM_NAME}=="?*", NAME="$kernel", SYMLINK+="(DM_DIR)/$env{DM_NAME}"
+ENV{DM_NAME}=="?*", SYMLINK+="(DM_DIR)/$env{DM_NAME}"
-# We have to ignore further rule application for temporary
-# cryptsetup devices. But don't forget to send the notification!
+# We have to ignore further rule application for inappropriate events
+# and devices. But still send the notification if cookie exists.
+ENV{DM_UUID}=="mpath-?*", ENV{DM_ACTION}=="PATH_FAILED", GOTO="dm_last_rule"
ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="dm_last_rule"
ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="dm_last_rule"