[PATCH] pattern match for label method

switch LABEL search to pattern match
  add a test for pattern match in LABEL
  remove useless rule from udev.rules
This commit is contained in:
kay.sievers@vrfy.org 2003-12-04 19:21:31 -08:00 committed by Greg KH
parent 28d6536a0f
commit 83be97ba21
3 changed files with 13 additions and 2 deletions

View File

@ -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);

View 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
},
{

View 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"