[PATCH] xserver: add udev/systemd multi-seat support

Dan Nicholson dbn.lists at gmail.com
Wed Jul 20 17:22:10 PDT 2011


On Wed, Jul 20, 2011 at 4:55 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> On Wed, Jul 20, 2011 at 08:23:15PM +0200, Lennart Poettering wrote:
>> On Wed, 20.07.11 06:08, Dan Nicholson (dbn.lists at gmail.com) wrote:
>>
>> > > 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.
>> >
>> > This is already done in the kernel, so I don't see why we're doing
>> > anything wrong here.
>>
>> Well, the current Wacom userspace rule adds in a pretty name in
>> userspace, which however is something we generally try to avoid, simply
>> because sooner or later people will ask that "Wacom Serial Tablet" shows
>> up as "Wacom Serielles Eingabetablett" on de_DE machines. Having pretty
>> names in such a low level database is problematic.
>
> how is this different to assigning the name to ID_MODEL or whatever else in
> userspace? "Serial Wacom Tablet" beats the empty string.
>
>> > I'm pretty sure hal did the same thing, which is where I looked when I
>> > added that code. What I always thought would be much more appropriate
>> > is if one of the udev rules standardized this name under a
>> > ID_INPUT_NAME property or something like that. The other thing that
>> > always kind of bugged me here is that this is the name that's matched
>> > with MatchProduct and it's not really the product name, but that's
>> > another story.
>>
>> Well, HAL is pretty good as an excercise how not do things ;-)
>>
>> Most devices use ID_MODEL and ID_MODEL_FROM_DATABASE as generic model
>> description strings.
>
> ok, I sat down yesterday and wrote the two small patches attached to parse
> ID_MODEL before the parent's NAME. and right now, it's not usable.
>
> NAME on the parent gives me NAME="Apple Wireless Trackpad"
> ID_MODEL on the device gives me ID_MODEL=BCM2045B
> I know which one I'd prefer in the logs...
>
> so unless I did something majorly wrong in the first patch (attached), I
> don't think we can switch to ID_MODEL without fixing udev first and
> requiring the new version.

I think the ideal thing would be ID_MODEL_FROM_DATABASE, which comes
out of the usb.ids file and could potentially be used instead of NAME.
This is, unfortunately, not wired up currently in the udev rules. Try
adding this to 60-persistent-input.rules:

SUBSYSTEMS=="usb", ENV{ID_VENDOR_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"

Now you should see something for ID_VENDOR_FROM_DATABASE and
ID_MODEL_FROM_DATABASE for a typical USB device. What you could do is
use these properties to compare to MatchVendor and MatchProduct,
respectively. The only drawback here is that for usb devices now we
get the whole name including vendor from NAME and compare that against
MatchProduct.

What comes out of usb.ids to ID_MODEL_DATABASE to MatchProduct doesn't
contain the vendor name. That could break people's configs who are
currently doing MatchProduct "Logitech". Also, we'd be depending on
strings from an external database that could have different entries
from the onboard descriptor (my keyboard sadly doesn't have a device
entry in usb.ids).

--
Dan


More information about the xorg-devel mailing list