]> err.no Git - systemd/commitdiff
[PATCH] pattern match for label method
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Fri, 5 Dec 2003 03:21:31 +0000 (19:21 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:13:06 +0000 (21:13 -0700)
  switch LABEL search to pattern match
  add a test for pattern match in LABEL
  remove useless rule from udev.rules

namedev.c
test/udev-test.pl
udev.rules

index ea75bc5d8f661f9ab6bd5f4e25ed5033e67e6178..1faa253c1e9b8685da16c5413d585b202383c8b0 100644 (file)
--- 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);
index 97f75edc94377b1b8bb3cf97365db527712d2b59..b1757ee1bb587a972ad7a14ca9371e0a6a1e4bf5 100644 (file)
@@ -49,6 +49,18 @@ EOF
                expected => "boot_disk1" ,
                conf     => <<EOF
 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
        },
        {
index 44fdb2561d387e24a8a942434d4e67e562a0a1c8..3044a87b44bd83b68273f82d84eb93ca0bf43b1b 100644 (file)
@@ -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"