linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [ANNOUNCE] udev 007 release
Date: Tue, 02 Dec 2003 15:16:16 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-107037844320966@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-106963388124982@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

On Mon, Dec 01, 2003 at 04:55:57PM -0800, Greg KH wrote:
> On Mon, Dec 01, 2003 at 11:51:19AM +0100, Marco d'Itri wrote:
> > On Nov 26, Greg KH <greg@kroah.com> wrote:

> >  >And then as your last REPLACE rule do:
> >  >	REPLACE, KERNEL="tty*", NAME="vc/%n"
> > I tried it, but it does not work. (And what about /dev/tty?)
> 
> Care to enable DEBUG_PARSE in namedev.c and send me the output when
> trying this?  Along with your config files.

Sorry, but we don't match against a wildcard now.
Please try the following patch:

01-catch--replace-device-by-wildcard.diff
  catch device name by wildcard to support a whole class of devices
  by just one config line like:
  REPLACE, KERNEL="tty*", NAME="vc/%n"


thanks,
Kay

[-- Attachment #2: 01-catch--replace-device-by-wildcard.diff --]
[-- Type: text/plain, Size: 944 bytes --]

diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c	Tue Dec  2 16:03:35 2003
+++ b/namedev.c	Tue Dec  2 16:03:35 2003
@@ -860,8 +860,8 @@
 			continue;
 
 		dbg_parse("compare name '%s' with '%s'",
-			  dev->kernel_name, dev->name);
-		if (strcmp(dev->kernel_name, class_dev->name) != 0)
+			  dev->kernel_name, class_dev->name);
+		if (strncmp_wildcard(class_dev->name, dev->kernel_name, NAME_SIZE) != 0)
 			continue;
 
 		strfieldcpy(udev->name, dev->name);
diff -Nru a/test/udev-test.pl b/test/udev-test.pl
--- a/test/udev-test.pl	Tue Dec  2 16:03:35 2003
+++ b/test/udev-test.pl	Tue Dec  2 16:03:35 2003
@@ -51,6 +51,15 @@
 EOF
 	},
 	{
+		desc     => "catch device by wildcard",
+		subsys   => "tty",
+		devpath  => "class/tty/ttyUSB0",
+		expected => "visor/0" ,
+		conf     => <<EOF
+REPLACE, KERNEL="ttyUSB*", NAME="visor/%n"
+EOF
+	},
+	{
 		desc     => "replace kernel name",
 		subsys   => "tty",
 		devpath  => "class/tty/ttyUSB0",

  parent reply	other threads:[~2003-12-02 15:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-24  0:29 [ANNOUNCE] udev 007 release Greg KH
2003-11-24  3:19 ` Arnd Bergmann
2003-11-24 23:40 ` Greg KH
2003-11-25 13:29 ` Marco d'Itri
2003-11-26 19:28 ` Greg KH
2003-12-01 10:51 ` Marco d'Itri
2003-12-02  0:55 ` Greg KH
2003-12-02 15:16 ` Kay Sievers [this message]
2003-12-02 16:27 ` Kay Sievers
2003-12-02 17:21 ` Marco d'Itri
2003-12-02 17:42 ` Kay Sievers
2003-12-02 17:54 ` Greg KH
2003-12-02 17:55 ` Greg KH
2003-12-02 18:04 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-107037844320966@msgid-missing \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).