Most of the documentation I've seen for udev deals with USB, where you have a device ID to play with. I was hoping someone could help me set up udev rules for serial ports. I have a Palm IIIx that needs to sync over a serial port. I would like to change the permissions on the port to which the Palm is connected to 0666 while leaving all other serial ports (like the one that has the modem on it) at 0660 and, here's the kicker, do it without changing 50-udev.rules.
Currently, /etc/udev/rules.d/50-udev.rules has this rule:
I tried adding a 10-local.rules file containing this:Code:KERNEL=="ttyS*", GROUP="uucp", MODE="0660"
to override the general rule for ttyS0. If I then run udevstart to reset /dev, I wind up with permission 0600 -- no idea why, except maybe udev is reverting to its compiled-in default.Code:KERNEL=="ttyS0", GROUP="uucp", MODE="0666"
I've set /etc/udev/udev.conf's udev_log setting to "debug" but see no output in /var/log/messages. If I add a PROGRAM tag that calls logger to the rule, it'll generate output, so I know udev is processing the file.
Next step was to try incorporating the rule directly into 50-udev.rules. If I remove 10-local.rules and modify 50-udev.rules to look like this:
I get permission 0660. On the other hand, this version produces 0666:Code:KERNEL=="ttyS0", GROUP="uucp", MODE="0666" KERNEL=="ttyS*", GROUP="uucp", MODE="0660"
Finally, I'm not sure, but does udev consistently assign ttyS0 to the first serial port and ttyS1 to the second? At one point, it seemed like they might've shifted, but I've no idea how to write a rule that would consistently identify a serial port Palm Pilot rather than a USB one.Code:KERNEL=="ttyS0", GROUP="uucp", MODE="0666" KERNEL=="ttyS[1-9]", GROUP="uucp", MODE="0660" KERNEL=="ttyS[1-3][0-9]", GROUP="uucp", MODE="0660"
I've temporarily worked around the problem by adding my account to the uucp group, but what I'd really like is a /dev/pilot or /dev/cradle with permission 0666 that consistently points to the serial port where the cradle's plugged in. Any suggestions?


Reply With Quote
