Comment 2 for bug 317442

Revision history for this message
Shiv V (svenkata) wrote :

I took a look at all the rules in /lib/udev/rules.d and noticed that every 'NAME=' assignment is preceeded by a conditional (e.g. KERNEL== or SUBSYSTEM==). Adding a conditional seems to make the rule apply. Here's what I did:

--- a/lib/udev/rules.d/65-dmsetup.rules 2009-01-09 06:02:58.000000000 -0800
+++ b/lib/udev/rules.d/65-dmsetup.rules 2009-01-15 10:55:14.000000000 -0800
@@ -11,7 +11,8 @@
 ENV{DM_NAME}=="temporary-cryptsetup-*", OPTIONS="ignore_device"

 # Make the device take the /dev/mapper name
-OPTIONS+="string_escape=none", NAME="mapper/$env{DM_NAME}"
+#KERNEL=="dm-*", OPTIONS+="string_escape=none", NAME="mapper/$env{DM_NAME}"
+KERNEL=="dm-*", NAME="mapper/$env{DM_NAME}"
 SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
 ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"

The weird thing is that it would not work with OPTIONS+=... even with KERNEL==... I don't understand this at all but udevadm test now applies the NAME rule. Perhaps I should poke around in the udev source