Forwarding a discussion from the xorg-devel list that will be of interest to
distributors. original message here:
http://lists.freedesktop.org/archives/xorg-devel/2011-July/023939.html
The rules file discussed was the one we shipped in Fedora:
---- %< ----
ACTION!="add|change", GOTO="wacom_end"
# Match all wacom tablets with a serial ID starting with WACf
ATTRS{id}=="WACf*" ENV{NAME}="Serial Wacom Tablet", ENV{SUBSYSTEM}="input",
ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
ATTRS{id}=="FUJ*" ENV{NAME}="Serial Wacom Tablet", ENV{SUBSYSTEM}="input",
ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
LABEL="wacom_end"
---- >% ----
On Mon, 18.07.11 19:29, Lennart Poettering wrote:
[...]
So, I had another closer look on this, and now understand what is going
on. This rules file is actually really really borked, and really needs
to be fixed. And not only this files is borked, the matching code in X11
is borked too.
If I understand this properly, then the wacom serial tablets come with
their own special ISAPNP serial port?
So here's what needs to be fixed:
1) You cannot overide ENV{SUBSYSTEM}. This env var encodes to which
kernel subsystem a device belongs to. Just by overriding this in
userspace you cannot make it move to a different piece of code! This
will break things if left in this way. In fact, after I told Kay about
this he has now added code to udev to explicitly disallow lines like
this. That means these lines will stop working with newer udev unless
they are fixed to stop doing this.
2) If you introduce your own env vars on devices, you are not allowed
not to prefix them. Unprefixed variables are private property of the
kernel. Userspace may only add prefixed variables to that. A common
prefix used is ID_, but you can choose whatever you want. This needs
fixing too. You need to find a better variable than "NAME" to store
your device name.
3) We try to avoid setting pretty names in udev rules, since they might
need translations later on. Hence having a property like "NAME" here
isn't a good idea at all -- not even if you rename it.
4) If you just check attr{id} like you do in those rules this will cause
*all* devices' id attribute to be read, and if if they happen to include
"FUJ" as prefix, you'll mark them as tablet. Example: an audio driver
also exposes an id property, you can even set it to whatevr you want via
a module argument. If a poor soul has a sound card with an id of "FUJ"
then your rule will mark it as input device for X.
To fix this: since the devices in question show up as ISAPNP devices,
this is what you need to check for. i.e. instead of this:
ATTRS{id}=="FUJ*", ...
use this:
SUBSYSTEMS="pnp", ATTRS{id}=="FUJ*", ...
5) You are now adding your properties to *every* child device of the pnp
device which is very much broken. You should only add it to the serial
port itself. I.e. you also need to check SUBSYSTEM="tty". (Singular, not
plural in this case).
6) Where a device shows up in the device tree is not considered ABI,
kernel devs are free and happy to add new layers to the tree where
necessary. That means in the X11 udev code you cannot use
udev_device_get_parent() to check the parent device of the wacom tablet,
assuming it was a pnp device. This is borked and will break at any
time. Use udev_device_get_parent_with_subsystem_devtype() instead, or
much better: assign the properties you are looking for to the serial
device itself, via the udev rule, by inheriting them as necessary.
[...]
And again, Kay has changed udev now so that the wacom rule will fail,
due to 1). If this rule file isn't fixed then wacom devices will just
stop working very soon.
[...]
----- End forwarded message -----
The amended rules file now looks like this:
---- %< ----
ACTION!="add|change", GOTO="wacom_end"
# Match all wacom tablets with a serial ID starting with WACf
SUBSYSTEM="tty", SUBSYSTEMS="pnp", ATTRS{id}=="WACf*", ENV{ID_MODEL}="Serial
Wacom Tablet $attr{id}", ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
SUBSYSTEM="tty", SUBSYSTEMS="pnp", ATTRS{id}=="FUJ*", ENV{ID_MODEL}="Serial
Wacom Tablet $attr{id}", ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
LABEL="wacom_end"
---- >% ----
Cheers,
Peter
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel