summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--namedev.c2
-rw-r--r--test/udev-test.pl12
-rw-r--r--udev.rules1
3 files changed, 13 insertions, 2 deletions
diff --git a/namedev.c b/namedev.c
index ea75bc5d8f..1faa253c1e 100644
--- a/namedev.c
+++ b/namedev.c
@@ -412,7 +412,7 @@ label_found:
*c = 0x00;
dbg("compare attribute '%s' value '%s' with '%s'",
dev->sysfs_file, tmpattr->value, dev->sysfs_value);
- if (strcmp(dev->sysfs_value, tmpattr->value) != 0)
+ if (strcmp_pattern(dev->sysfs_value, tmpattr->value) != 0)
continue;
strfieldcpy(udev->name, dev->name);
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 97f75edc94..b1757ee1bb 100644
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -52,6 +52,18 @@ LABEL, BUS="scsi", vendor="IBM-ESXS", NAME="boot_disk%n"
EOF
},
{
+ desc => "label test of pattern match",
+ subsys => "block",
+ devpath => "block/sda/sda1",
+ expected => "boot_disk1" ,
+ conf => <<EOF
+LABEL, BUS="scsi", vendor="?IBM-ESXS", NAME="boot_disk%n-1"
+LABEL, BUS="scsi", vendor="IBM-ESXS?", NAME="boot_disk%n-2"
+LABEL, BUS="scsi", vendor="IBM-ES??", NAME="boot_disk%n"
+LABEL, BUS="scsi", vendor="IBM-ESXSS", NAME="boot_disk%n-3"
+EOF
+ },
+ {
desc => "catch device by *",
subsys => "tty",
devpath => "class/tty/ttyUSB0",
diff --git a/udev.rules b/udev.rules
index 44fdb2561d..3044a87b44 100644
--- a/udev.rules
+++ b/udev.rules
@@ -42,7 +42,6 @@ REPLACE, KERNEL="ttyUSB1", NAME="visor"
REPLACE, KERNEL="ttyUSB0", NAME="pl2303"
# a devfs like way to name some tty devices
-#REPLACE, KERNEL="tty", NAME="tty"
#REPLACE, KERNEL="ttyS*", NAME="tts/%n"
#REPLACE, KERNEL="tty*", NAME="vc/%n"