* [ANNOUNCE] udev 007 release
@ 2003-11-24 0:29 Greg KH
2003-11-24 3:19 ` Arnd Bergmann
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: Greg KH @ 2003-11-24 0:29 UTC (permalink / raw)
To: linux-hotplug
I've released the 007 version of udev. It can be found at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-007.tar.gz
udev is a implementation of devfs in userspace using sysfs and
/sbin/hotplug. It requires a 2.6 kernel to run. Please see the udev
FAQ for any questions about it:
kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ
Note:
The CALLOUT rule format has changed. If you have a config file
using this rule, please change it to follow the new order. See
the man page for the proper style.
The major changes since the 006 release are:
- better parsing of the udev.permissions file
- string owner and group names in the udev.permissions file will
now work if you build against glibc.
- fix the CALLOUT rule to look the same as the other rules.
- add format char for CALLOUT rule output
- support arguments in callout exec
- add ability for CALLOUT program to accept format modifiers.
- drop Makefile.klibc. To build using klibc, use:
make KLIBC=true
- updated man page documenting new changes.
Again, many thanks to Kay Sievers, for lots of great patches in this
release. Thanks also to Marco d'Itri and Olaf Hering, both of whom
submitted patches for this release.
I think with the ability to capture the output of the CALLOUT rule,
combined with the ability to put format modifiers in the CALLOUT program
string, we now have everything in place to emulate the existing devfs
naming scheme. Anyone want to verify this or not?
The full ChangeLog can be found below.
udev development is done in a BitKeeper repository loacated at:
bk://linuxusb.bkbits.net/udev
Daily snapshots of this tree can be found at:
http://www.codemonkey.org.uk/projects/bitkeeper/udev/
Many thanks to Dave Jones for managing this.
thanks,
greg k-h
Summary of changes from v006 to v007
======================
<md:linux.it>:
o fix segfault in parsing bad udev.permissions file
Greg Kroah-Hartman:
o update default config file with a CALLOUT rule, and more documentation
o updated the man page with the latest format specifier changes
o added ability to put format specifiers in the CALLOUT program string
o tweak udev-test.pl to report '0' errors if that's what happened
o only build klibc_fixups.c if we are actually using klibc
o add support for string group and string user names in udev.permissions
o add getgrnam and getpwnam to klibc_fixups files
o remove Makefile.klibc
o add udev-test perl script from Kay Sievers <kay.sievers@vrfy.org> which blows away my puny shell scripts
o added debian's version of udev.permissions
o change to 006_bk version
Kay Sievers:
o format char for CALLOUT output
o more namedev whitespace cleanups
o support arguments in callout exec
o namedev.c - change order of fields in CALLOUT
o namedev.c whitespace + debug text cleanup
o man page with udev.permissions wildcard
Olaf Hering:
o static klibc udev does not link against crt0.o
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
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
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2003-11-24 3:19 UTC (permalink / raw)
To: linux-hotplug
On Monday 24 November 2003 01:29, Greg KH wrote:
> I think with the ability to capture the output of the CALLOUT rule,
> combined with the ability to put format modifiers in the CALLOUT program
> string, we now have everything in place to emulate the existing devfs
> naming scheme. Anyone want to verify this or not?
I would prefer to have the ability of creating partition nodes in devfs
style built-in to udev. Devfs used to call the whole disk e.g.
"/dev/dasd/0123/disk" and the partitions "/dev/dasd/0123/part[1-3]".
This can obviously be done with a CALLOUT rule, but its common enough
to make it a format modifier. AFAIK, this scheme has been used for
ide, scsi and dasd disks, which is about 99% of all disks ever connected
to Linux.
One thing that does not appear to be possible with udev but was common
with devfs is to have multiple links for the same device node, e.g.
/dev/hda1 as well as /dev/ide/host0/bus0/target0/lun0/part1 and
/dev/disk/0/part1.
Arnd <><
=== namedev.c 1.45 vs edited ==--- 1.45/namedev.c Sun Nov 23 23:25:12 2003
+++ edited/namedev.c Mon Nov 24 04:01:10 2003
@@ -523,6 +523,15 @@
strcat(pos, udev->kernel_number);
dbg("substitute kernel number '%s'", udev->kernel_number);
break;
+ case 'N':
+ if (strlen(udev->kernel_number) = 0) {
+ strcat(pos, "disk");
+ break;
+ }
+ strcat(pos, "part");
+ strcat(pos, udev->kernel_number);
+ dbg("substitute kernel number '%s'", udev->kernel_number);
+ break;
case 'm':
sprintf(pos, "%u", udev->minor);
dbg("substitute minor number '%u'", udev->minor);
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
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
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2003-11-24 23:40 UTC (permalink / raw)
To: linux-hotplug
On Mon, Nov 24, 2003 at 04:19:45AM +0100, Arnd Bergmann wrote:
> On Monday 24 November 2003 01:29, Greg KH wrote:
>
> > I think with the ability to capture the output of the CALLOUT rule,
> > combined with the ability to put format modifiers in the CALLOUT program
> > string, we now have everything in place to emulate the existing devfs
> > naming scheme. Anyone want to verify this or not?
>
> I would prefer to have the ability of creating partition nodes in devfs
> style built-in to udev. Devfs used to call the whole disk e.g.
> "/dev/dasd/0123/disk" and the partitions "/dev/dasd/0123/part[1-3]".
> This can obviously be done with a CALLOUT rule, but its common enough
> to make it a format modifier. AFAIK, this scheme has been used for
> ide, scsi and dasd disks, which is about 99% of all disks ever connected
> to Linux.
Ok, that makes sense. I've applied this patch, but used the 'D'
modifier (for Devfs name). Is that ok with you?
> One thing that does not appear to be possible with udev but was common
> with devfs is to have multiple links for the same device node, e.g.
> /dev/hda1 as well as /dev/ide/host0/bus0/target0/lun0/part1 and
> /dev/disk/0/part1.
Yes, we need to add support for both multiple names, and symlinks. It's
on the TODO list I think (well the symlinks are, multiple names should
be if it isn't.)
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
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
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Marco d'Itri @ 2003-11-25 13:29 UTC (permalink / raw)
To: linux-hotplug
On Nov 24, Arnd Bergmann <arnd@arndb.de> wrote:
>+ case 'N':
>+ if (strlen(udev->kernel_number) = 0) {
>+ strcat(pos, "disk");
>+ break;
>+ }
>+ strcat(pos, "part");
>+ strcat(pos, udev->kernel_number);
>+ dbg("substitute kernel number '%s'", udev->kernel_number);
>+ break;
After seeing this I started thinking about devfs-like devices and I
tough that, as soon as the kernel will export a node which will allow
recognizing CD devices, this could part of the default udev.config
shipped by a distribution (I'd like to do this for debian):
NUMBER, BUS="ide", id="0.0", NAME="ide/host0/bus0/target0/lun0/%N"
NUMBER, BUS="ide", id="0.1", NAME="ide/host0/bus0/target1/lun0/%N"
NUMBER, BUS="ide", id="1.0", NAME="ide/host0/bus1/target0/lun0/%N"
NUMBER, BUS="ide", id="1.1", NAME="ide/host0/bus1/target1/lun0/%N"
NUMBER, BUS="ide", id="0.0", type="cd", NAME="ide/host0/bus0/target0/lun0/cd"
NUMBER, BUS="ide", id="0.1", type="cd", NAME="ide/host0/bus0/target1/lun0/cd"
NUMBER, BUS="ide", id="1.0", type="cd", NAME="ide/host0/bus1/target0/lun0/cd"
NUMBER, BUS="ide", id="1.1", type="cd", NAME="ide/host0/bus1/target1/lun0/cd"
And this could be a possible syntax for managing symlinks: LINK would
work just like NUMBER, but NAME would be a symlink to the device
specified:
# a trailing / means that the link will be done to the parent directory
LINK, BUS="ide", id="0.0", NAME="discs/disc0/"
LINK, BUS="ide", id="0.1", NAME="discs/disc1/"
LINK, BUS="ide", id="1.0", NAME="discs/cdrom0"
LINK, BUS="ide", id="1.1", NAME="discs/cdrom1"
Related problem: if the ide-cd driver is modular then at boot time the
block device nodes will not appear in sysfs, so udev will not create the
devices in /dev. But if there are no devices which applications can
open, how can the kernel autoload the module?
Currently no hotplug method deals with this, so I'm not sure about what
should load ide-cd at boot time.
BTW, how can I configure udev to create devices like vc/%n instead of
tty%n?
--
ciao, |
Marco | [3275 fipApyPRskOns]
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (2 preceding siblings ...)
2003-11-25 13:29 ` Marco d'Itri
@ 2003-11-26 19:28 ` Greg KH
2003-12-01 10:51 ` Marco d'Itri
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2003-11-26 19:28 UTC (permalink / raw)
To: linux-hotplug
On Tue, Nov 25, 2003 at 02:29:17PM +0100, Marco d'Itri wrote:
> On Nov 24, Arnd Bergmann <arnd@arndb.de> wrote:
>
> >+ case 'N':
> >+ if (strlen(udev->kernel_number) = 0) {
> >+ strcat(pos, "disk");
> >+ break;
> >+ }
> >+ strcat(pos, "part");
> >+ strcat(pos, udev->kernel_number);
> >+ dbg("substitute kernel number '%s'", udev->kernel_number);
> >+ break;
>
> After seeing this I started thinking about devfs-like devices and I
> tough that, as soon as the kernel will export a node which will allow
> recognizing CD devices, this could part of the default udev.config
> shipped by a distribution (I'd like to do this for debian):
>
> NUMBER, BUS="ide", id="0.0", NAME="ide/host0/bus0/target0/lun0/%N"
> NUMBER, BUS="ide", id="0.1", NAME="ide/host0/bus0/target1/lun0/%N"
> NUMBER, BUS="ide", id="1.0", NAME="ide/host0/bus1/target0/lun0/%N"
> NUMBER, BUS="ide", id="1.1", NAME="ide/host0/bus1/target1/lun0/%N"
> NUMBER, BUS="ide", id="0.0", type="cd", NAME="ide/host0/bus0/target0/lun0/cd"
> NUMBER, BUS="ide", id="0.1", type="cd", NAME="ide/host0/bus0/target1/lun0/cd"
> NUMBER, BUS="ide", id="1.0", type="cd", NAME="ide/host0/bus1/target0/lun0/cd"
> NUMBER, BUS="ide", id="1.1", type="cd", NAME="ide/host0/bus1/target1/lun0/cd"
Hm, two different rules for the same id. Not a good idea, udev can not
handle this. How about a LABEL rule for a cd instead.
But you are going to have to do a CALLOUT rule if you want to create
names like "ide/host0/bus0/target0/lun0" properly, so you might as well
do it all in a external script. Makes it much easier for you :)
> And this could be a possible syntax for managing symlinks: LINK would
> work just like NUMBER, but NAME would be a symlink to the device
> specified:
>
> # a trailing / means that the link will be done to the parent directory
> LINK, BUS="ide", id="0.0", NAME="discs/disc0/"
> LINK, BUS="ide", id="0.1", NAME="discs/disc1/"
> LINK, BUS="ide", id="1.0", NAME="discs/cdrom0"
> LINK, BUS="ide", id="1.1", NAME="discs/cdrom1"
No, I think multiple NAME values on a line would be the best thing, but
that will take some major tweaks to udev to get there. We will get
there...
> Related problem: if the ide-cd driver is modular then at boot time the
> block device nodes will not appear in sysfs, so udev will not create the
> devices in /dev. But if there are no devices which applications can
> open, how can the kernel autoload the module?
> Currently no hotplug method deals with this, so I'm not sure about what
> should load ide-cd at boot time.
That's up to your startup scripts :)
Look at how Red Hat does this for an example of this.
> BTW, how can I configure udev to create devices like vc/%n instead of
> tty%n?
For USB tty devices try:
REPLACE, KERNEL="ttyUSB*", NAME="usb/%n"
So create such a rule for all of the different tty device types.
And then as your last REPLACE rule do:
REPLACE, KERNEL="tty*", NAME="vc/%n"
Hope this helps,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (3 preceding siblings ...)
2003-11-26 19:28 ` Greg KH
@ 2003-12-01 10:51 ` Marco d'Itri
2003-12-02 0:55 ` Greg KH
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Marco d'Itri @ 2003-12-01 10:51 UTC (permalink / raw)
To: linux-hotplug
On Nov 26, Greg KH <greg@kroah.com> wrote:
>> NUMBER, BUS="ide", id="0.0", NAME="ide/host0/bus0/target0/lun0/%N"
>> NUMBER, BUS="ide", id="0.1", NAME="ide/host0/bus0/target1/lun0/%N"
>> NUMBER, BUS="ide", id="1.0", NAME="ide/host0/bus1/target0/lun0/%N"
>> NUMBER, BUS="ide", id="1.1", NAME="ide/host0/bus1/target1/lun0/%N"
>> NUMBER, BUS="ide", id="0.0", type="cd", NAME="ide/host0/bus0/target0/lun0/cd"
>> NUMBER, BUS="ide", id="0.1", type="cd", NAME="ide/host0/bus0/target1/lun0/cd"
>> NUMBER, BUS="ide", id="1.0", type="cd", NAME="ide/host0/bus1/target0/lun0/cd"
>> NUMBER, BUS="ide", id="1.1", type="cd", NAME="ide/host0/bus1/target1/lun0/cd"
>
>Hm, two different rules for the same id. Not a good idea, udev can not
>handle this. How about a LABEL rule for a cd instead.
I tought that a sysfs attribute would have been enough to disambiguate
the rules.
>But you are going to have to do a CALLOUT rule if you want to create
>names like "ide/host0/bus0/target0/lun0" properly, so you might as well
>do it all in a external script. Makes it much easier for you :)
Why? The names do not change, as they depend on the ide bus positions.
>
>> And this could be a possible syntax for managing symlinks: LINK would
>> work just like NUMBER, but NAME would be a symlink to the device
>> specified:
>>
>> # a trailing / means that the link will be done to the parent directory
>> LINK, BUS="ide", id="0.0", NAME="discs/disc0/"
>> LINK, BUS="ide", id="0.1", NAME="discs/disc1/"
>> LINK, BUS="ide", id="1.0", NAME="discs/cdrom0"
>> LINK, BUS="ide", id="1.1", NAME="discs/cdrom1"
>
>No, I think multiple NAME values on a line would be the best thing, but
>that will take some major tweaks to udev to get there. We will get
>there...
Multiple names have the downside that admins will have to modify the
"standard" rules, while with different rules they could just add the
appropriate aliases at the end of the config file.
>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?)
--
ciao, |
Marco | [3389 laQYHWJk.JWkI]
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (4 preceding siblings ...)
2003-12-01 10:51 ` Marco d'Itri
@ 2003-12-02 0:55 ` Greg KH
2003-12-02 15:16 ` Kay Sievers
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2003-12-02 0:55 UTC (permalink / raw)
To: linux-hotplug
On Mon, Dec 01, 2003 at 11:51:19AM +0100, Marco d'Itri wrote:
> On Nov 26, Greg KH <greg@kroah.com> wrote:
>
> >> NUMBER, BUS="ide", id="0.0", NAME="ide/host0/bus0/target0/lun0/%N"
> >> NUMBER, BUS="ide", id="0.1", NAME="ide/host0/bus0/target1/lun0/%N"
> >> NUMBER, BUS="ide", id="1.0", NAME="ide/host0/bus1/target0/lun0/%N"
> >> NUMBER, BUS="ide", id="1.1", NAME="ide/host0/bus1/target1/lun0/%N"
> >> NUMBER, BUS="ide", id="0.0", type="cd", NAME="ide/host0/bus0/target0/lun0/cd"
> >> NUMBER, BUS="ide", id="0.1", type="cd", NAME="ide/host0/bus0/target1/lun0/cd"
> >> NUMBER, BUS="ide", id="1.0", type="cd", NAME="ide/host0/bus1/target0/lun0/cd"
> >> NUMBER, BUS="ide", id="1.1", type="cd", NAME="ide/host0/bus1/target1/lun0/cd"
> >
> >Hm, two different rules for the same id. Not a good idea, udev can not
> >handle this. How about a LABEL rule for a cd instead.
> I tought that a sysfs attribute would have been enough to disambiguate
> the rules.
Yeah, that would work. I just fixed a bug where the NAME was the same,
but the BUS was different. That previously didn't work at all.
Care to send a patch?
> >> And this could be a possible syntax for managing symlinks: LINK would
> >> work just like NUMBER, but NAME would be a symlink to the device
> >> specified:
> >>
> >> # a trailing / means that the link will be done to the parent directory
> >> LINK, BUS="ide", id="0.0", NAME="discs/disc0/"
> >> LINK, BUS="ide", id="0.1", NAME="discs/disc1/"
> >> LINK, BUS="ide", id="1.0", NAME="discs/cdrom0"
> >> LINK, BUS="ide", id="1.1", NAME="discs/cdrom1"
> >
> >No, I think multiple NAME values on a line would be the best thing, but
> >that will take some major tweaks to udev to get there. We will get
> >there...
> Multiple names have the downside that admins will have to modify the
> "standard" rules, while with different rules they could just add the
> appropriate aliases at the end of the config file.
True. Ok, well, as neither are implemented yet, it's not really a big
deal right now :)
> >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.
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (5 preceding siblings ...)
2003-12-02 0:55 ` Greg KH
@ 2003-12-02 15:16 ` Kay Sievers
2003-12-02 16:27 ` Kay Sievers
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Kay Sievers @ 2003-12-02 15:16 UTC (permalink / raw)
To: linux-hotplug
[-- 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",
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (6 preceding siblings ...)
2003-12-02 15:16 ` Kay Sievers
@ 2003-12-02 16:27 ` Kay Sievers
2003-12-02 17:21 ` Marco d'Itri
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Kay Sievers @ 2003-12-02 16:27 UTC (permalink / raw)
To: linux-hotplug
On Tue, Dec 02, 2003 at 04:16:16PM +0100, Kay Sievers wrote:
> 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"
>
Ups, please use these config lines, in this order as a temporary
workaround, to catch the other devices starting with tty*,
the same is needed for ttyUSB*, ...
REPLACE, KERNEL="tty*", NAME="vc/%n"
REPLACE, KERNEL="ttyS*", NAME="tts/%n"
REPLACE, KERNEL="tty", NAME="tty"
Greg, should we iterate backwards over the lists of methods?
It seems a bit confusing to put a catch all line at the beginning of the
config file to be precessed after all the others.
A better pattern matching seems unavoidable.
Is anyone already improving namedev's strncpm_wildcard()?
If nobody comes up, I will do it until tomorrow night :)
thanks,
Kay
-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (7 preceding siblings ...)
2003-12-02 16:27 ` Kay Sievers
@ 2003-12-02 17:21 ` Marco d'Itri
2003-12-02 17:42 ` Kay Sievers
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Marco d'Itri @ 2003-12-02 17:21 UTC (permalink / raw)
To: linux-hotplug
On Dec 02, Kay Sievers <kay.sievers@vrfy.org> wrote:
>A better pattern matching seems unavoidable.
>Is anyone already improving namedev's strncpm_wildcard()?
>If nobody comes up, I will do it until tomorrow night :)
At least [] characters classes should be implemented. Taking tty* as an
example, if you can't match on tty[0-9]+ you would have to individually
list 16 "tty<uppercase letter>" serial device names.
If a partial reimplementation of extended regexps is too much complex to
be worth it, then a good enough substitute would be the ability to match
on one or more numbers.
--
ciao, |
Marco | [3418 sezC8T3lqfIbc]
-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (8 preceding siblings ...)
2003-12-02 17:21 ` Marco d'Itri
@ 2003-12-02 17:42 ` Kay Sievers
2003-12-02 17:54 ` Greg KH
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Kay Sievers @ 2003-12-02 17:42 UTC (permalink / raw)
To: linux-hotplug
On Tue, Dec 02, 2003 at 06:21:52PM +0100, Marco d'Itri wrote:
> On Dec 02, Kay Sievers <kay.sievers@vrfy.org> wrote:
>
> >A better pattern matching seems unavoidable.
> >Is anyone already improving namedev's strncpm_wildcard()?
> >If nobody comes up, I will do it until tomorrow night :)
> At least [] characters classes should be implemented. Taking tty* as an
> example, if you can't match on tty[0-9]+ you would have to individually
> list 16 "tty<uppercase letter>" serial device names.
>
> If a partial reimplementation of extended regexps is too much complex to
> be worth it, then a good enough substitute would be the ability to match
> on one or more numbers.
Yes, this is already working in my tree:
REPLACE, KERNEL="tty[0-9]*", NAME="vc/%n"
Dec 2 18:30:57 pim udev[10109]: build_kernel_number: kernel_number='49'
Dec 2 18:30:57 pim udev[10109]: strncmp_wildcard: fnmatch p:ttyS* s:tty49 r:1
Dec 2 18:30:57 pim udev[10109]: strncmp_wildcard: fnmatch p:tty[0-9]* s:tty49 r:0
Dec 2 18:30:57 pim udev[10109]: apply_format: substitute kernel number '49'
Dec 2 18:30:57 pim udev[10109]: udev_add_device: name='vc/49'
Dec 2 18:30:57 pim udev[10109]: create_node: mknod(/udev/vc/49, 020666, 4, 49)
It's based on libc's fnmatch(), that supports (*, ?, []).
http://developer.novell.com/ndk/doc/libc/index.html?page=/ndk/doc/libc/libc_enu/data/amsgxku.html
But I have to port it to klibc.
I will do this tomorrow if nobody comes up with a better idea :)
Kay
-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (9 preceding siblings ...)
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
12 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2003-12-02 17:54 UTC (permalink / raw)
To: linux-hotplug
On Tue, Dec 02, 2003 at 05:27:09PM +0100, Kay Sievers wrote:
>
> Ups, please use these config lines, in this order as a temporary
> workaround, to catch the other devices starting with tty*,
> the same is needed for ttyUSB*, ...
>
> REPLACE, KERNEL="tty*", NAME="vc/%n"
> REPLACE, KERNEL="ttyS*", NAME="tts/%n"
> REPLACE, KERNEL="tty", NAME="tty"
>
>
> Greg, should we iterate backwards over the lists of methods?
> It seems a bit confusing to put a catch all line at the beginning of the
> config file to be precessed after all the others.
True, I just fixed this up to handle the rules in the order they are in
the config file (within the type of rule.) So
REPLACE, KERNEL="tty", NAME="tty"
REPLACE, KERNEL="ttyS*", NAME="tts/%n"
REPLACE, KERNEL="tty*", NAME="vc/%n"
should work now (well, it does for me...)
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (10 preceding siblings ...)
2003-12-02 17:54 ` Greg KH
@ 2003-12-02 17:55 ` Greg KH
2003-12-02 18:04 ` Greg KH
12 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2003-12-02 17:55 UTC (permalink / raw)
To: linux-hotplug
On Tue, Dec 02, 2003 at 04:16:16PM +0100, Kay Sievers wrote:
> 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"
Applied, thanks.
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 007 release
2003-11-24 0:29 [ANNOUNCE] udev 007 release Greg KH
` (11 preceding siblings ...)
2003-12-02 17:55 ` Greg KH
@ 2003-12-02 18:04 ` Greg KH
12 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2003-12-02 18:04 UTC (permalink / raw)
To: linux-hotplug
On Tue, Dec 02, 2003 at 06:42:04PM +0100, Kay Sievers wrote:
> Yes, this is already working in my tree:
> REPLACE, KERNEL="tty[0-9]*", NAME="vc/%n"
>
>
> Dec 2 18:30:57 pim udev[10109]: build_kernel_number: kernel_number='49'
> Dec 2 18:30:57 pim udev[10109]: strncmp_wildcard: fnmatch p:ttyS* s:tty49 r:1
> Dec 2 18:30:57 pim udev[10109]: strncmp_wildcard: fnmatch p:tty[0-9]* s:tty49 r:0
> Dec 2 18:30:57 pim udev[10109]: apply_format: substitute kernel number '49'
> Dec 2 18:30:57 pim udev[10109]: udev_add_device: name='vc/49'
> Dec 2 18:30:57 pim udev[10109]: create_node: mknod(/udev/vc/49, 020666, 4, 49)
>
>
> It's based on libc's fnmatch(), that supports (*, ?, []).
> http://developer.novell.com/ndk/doc/libc/index.html?page=/ndk/doc/libc/libc_enu/data/amsgxku.html
>
> But I have to port it to klibc.
> I will do this tomorrow if nobody comes up with a better idea :)
That looks like a good idea to me.
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2003-12-02 18:04 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).