Persistent USB to rs232 serial converter device name patch
Hi,
I've checked out the udev repo, hacked, and used git to
generate 5 patches, in mbox format. How
should I submit them for review? Email? Attachments?
The patches generate udev rules, in extras/rule_generator/, like the process that generates persistent nic names, only for ttyUSB devices. Device special file names are keyed to USB vendor id, product id, serial number, and port number.
This patch allows me to use a USB-to-serial converter attached to multiple serial consoles without having to worry that kernel usb enumeration changes or accidentally unplugging and re-plugging USB devices will alter the device special file names. I imagine it would be helpful for other applications; palm organizer-like devices come to mind. I think some of them show up as ttyUSB devices.
It's at the 'works for me' stage, tested with a Digi Edgeport 4/16. All other drivers are blacklisted because I've no clue what drivers report serial numbers, etc. (See code comments for further detail.) It would be nice if somebody who knows what the other drivers, uh, drive were to delete drivers from the blacklist.
I've not tested the changes to the Makefile that install the new files, nor the very last patch that moves a shared function into the rule_generator.functions library.
The rest of the code was tested with a 2.6.25.4 kernel on a debian etch system by installing the files manually and hacking to account for debian-ized file names.
I don't know what sort of "external tool" would be used to specify device names, but I gave the code that functionality to mimic the existing cd and net persistent generator code.
Karl <[email protected]>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Quoted 2 lines · Karl O. Pinc
The patches generate udev rules, in extras/rule_generator/, like the process that generates persistent nic names, only for ttyUSB devices.
Why not make it act like persistent-storage and persistent-input, and add symlinks? The persistent-net stuff can't do that because there is no such thing as a symlink to a net_device (and even if there was, the IFNAMSIZ constant in the kernel is too small to handle the longer names this would generate, and IFNAMSIZ is part of the userspace ABI). The persistent-cd stuff can't do that because its symlinks are named e.g. "cdrom1", and don't have the serial # or path in them, and it needs to have "cdrom1" always be the same device.
But persistent-storage creates a /dev/disk/by-id/ link that's named with the disk's SCSI or ATA (or whatever) identifying information, along with several other /dev/disk/by-*/ links using other info. I don't see any reason you couldn't do the same with e.g. /dev/ttyUSB/by-path/ and /dev/ttyUSB/by-id/ links. Of course ttyUSB could change; that's just the first name that came to mind.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIbLS4S5vET1Wea5wRAxdcAJ9utojzdBFUjYi4p7OsiKq1qyY4NwCg1FvS pD+srRu2KkfYhmeqk8Ka+j4=l1PR
-----END PGP SIGNATURE-----