summaryrefslogtreecommitdiffstats
path: root/udev/13-dm-disk.rules.in
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2012-02-20 19:38:40 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2012-02-20 19:38:40 +0000
commit6dd70f472a2ad72fab1fba728cdac5b40c44895b (patch)
tree07eb86d82d980dce52ab7d5d4ff3b9b1a34412e7 /udev/13-dm-disk.rules.in
parent815aa3555f39fc39ee540aacb55c1a19061bd122 (diff)
downloadlvm2-6dd70f472a2ad72fab1fba728cdac5b40c44895b.tar.gz
lvm2-6dd70f472a2ad72fab1fba728cdac5b40c44895b.tar.xz
lvm2-6dd70f472a2ad72fab1fba728cdac5b40c44895b.zip
Call built-in blkid conditionaly (udev version >= 176), call standard blkid
with full path otherwise.
Diffstat (limited to 'udev/13-dm-disk.rules.in')
-rw-r--r--udev/13-dm-disk.rules.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/udev/13-dm-disk.rules.in b/udev/13-dm-disk.rules.in
new file mode 100644
index 00000000..1920260a
--- /dev/null
+++ b/udev/13-dm-disk.rules.in
@@ -0,0 +1,38 @@
+# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
+#
+# This file is part of LVM2.
+
+# 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_end"
+ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="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"
+
+(BLKID_RULE)
+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}"
+
+# Add inotify watch to track changes on this device.
+# Using the watch rule is not optimal - it generates a lot of spurious
+# 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"
+
+LABEL="dm_end"