summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2010-04-28 13:37:36 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2010-04-28 13:37:36 +0000
commit942d6ef29ff0e8ae5f76ca50ed7570ae8f7c5a66 (patch)
treeeea63b49face763000a642e0fc1a19b0074939b8 /udev
parent8b7fc0da1105564a846d3820accafcb490a53ffe (diff)
downloadlvm2-942d6ef29ff0e8ae5f76ca50ed7570ae8f7c5a66.tar.gz
Add support for new IMPORT{db} udev rule.
This rule appeared in udev v152 and it helps us to support spurious events where we didn't have any flags set (events originated in udevadm trigger or the watch rule). These flags are important to direct the rule application. Now, with the help of this rule, we can regenerate old udev db content. To implement this correctly, we need to flag all proper DM udev events with DM_UDEV_PRIMARY_SOURCE_FLAG. That happens automatically for all ioctls generating events originated in libdevmapper.
Diffstat (limited to 'udev')
-rw-r--r--udev/10-dm.rules.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index 7cffc0bfb..0db88093a 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -44,6 +44,28 @@ ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env
ACTION!="add|change", GOTO="dm_end"
+# There is no cookie set nor any flags encoded in events not originating
+# in libdevmapper so we need to detect this and try to behave correctly.
+# For such spurious events, regenerate all flags from current udev database content
+# (this information would normally be inaccessible for spurious ADD and CHANGE events).
+ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_flags_done"
+IMPORT{db}="DM_UDEV_DISABLE_DM_RULES_FLAG"
+IMPORT{db}="DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG"
+IMPORT{db}="DM_UDEV_DISABLE_DISK_RULES_FLAG"
+IMPORT{db}="DM_UDEV_DISABLE_OTHER_RULES_FLAG"
+IMPORT{db}="DM_UDEV_LOW_PRIORITY_FLAG"
+IMPORT{db}="DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG"
+IMPORT{db}="DM_UDEV_FLAG7"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG0"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG1"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG2"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG3"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG4"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG5"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG6"
+IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG7"
+LABEL="dm_flags_done"
+
# 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