Using udev-extras for hardware-specific quirks?

Martin Pitt martin.pitt at ubuntu.com
Wed Jun 3 09:56:05 PDT 2009


Hello Daniel,

Daniel D Streetman [2009-06-03 10:48 -0400]:
> Well that is the problem, isn't it?  With serial ports there is absolutely
> nothing to go on to tell what physical port it is except for numbering.

Right, that might be more tricky. I actually can't test it here, it's
been a long time since I had a machine with a real serial port.

> Well, I don't think this will work as the problem isn't consistent naming -
> serial ports are not added/removed and so there is no danger of
> inconsistent numbering

I wouldn't rely too much on it. Ethernet cards aren't added/removed
either, and yet without the persistency rules they get a pretty much
random order on boot. I guess the ordering is more reliable for serial
ports since they are all covered by the same driver (unlike the two
ethernet cards I used to have).

> I could create permanent "persistent naming" rules such as the above one to
> correctly number the ports, but I don't think that is what you mean - you
> mean I should create a dynamic rule to create those persistent naming rules
> on-the-fly as serial ports are (first) detected.  That is what you mean
> right?

Not really on the fly, just attaching the name to a physical attribute
which stays constant across reboots. If there is none, then I guess
you can keep your current rules which just rename the interfaces.

> Also to clarify, I'm not looking to create a rule for just my system - I am
> trying to create a permanent rule that I can upstream into a common
> repository that all distributions can draw from so the various quirks on
> these systems can be correctly handled by all distributions.

Right, I understood your intention, but I don't think we want
arbitrary renaming like that, since they are going to have a different
effect on every machine anyway, and one order is as good as the other
usually.

> With serial ports?  How can an application not rely on the serial port
> number?  For other types of interfaces, USB devices, ethernet interfaces,
> displays, whatever - I can understand that.  But ever since serial ports
> were invented, the port number is the one and only thing the application
> can use.  Right?

Right, that's true. Probably one of the reasons why they are
considered "legacy".

Usually, when there is a device on a port, there is often a way to
probe that device instead of the port it is attached to (which is what
you actually want in most cases). That needs an external probe program
with RUN/IMPORT, and is very specific to the type of hardware you
attach.

> For PCI-card based serial ports, there are no other device properties
> besides the PCI address and kernel-assigned name.

The PCI device should have an unique physical slot name
(PCI_SLOT_NAME), but that won't help you, since I guess one PCI device
drives all of your serial ports?

So I think you should either locally keep your current renaming, or
perhaps just swap the stickers to have the correct number :)

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the devkit-devel mailing list