Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Wrong device permissions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 166

PostPosted: Thu Feb 21, 2013 7:54 am    Post subject: Wrong device permissions Reply with quote

First let me tell you a bit so you better understand the problem:
Some time ago I changed from openRC to systemD. Before you ask: No, I won't change back.
Now I got a new gamepad, connected it and... experienced wrong permissions of device nodes. According to this thread I have to be in the uinput group, but that's wrong/outdated, the device is made for root:root with 600:
Code:
$ ls -l /dev/uinput
crw------- 1 root root 10, 223 21. Feb 08:23 /dev/uinput

Looking at udev rules it should be 640:
Code:
$ grep uinput /lib/udev/rules.d/*
/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", MODE="0640"

But this is still wrong, I have to change it to 666 to be able to run xboxdrv as a regular user (being in the uinput group). Of course I have to do this after every reboot.

If you think that's all you are wrong. After starting xboxdrv I need to change two more permissions before I can use the device: /dev/input/event6 (for force-feedback) and /dev/input/js0:
Code:
$ ls -l /dev/input/event6 /dev/input/js0
crw-r----- 1 root root 13, 70 21. Feb 08:44 /dev/input/event6
crw-r--r-- 1 root root 13,  0 21. Feb 08:44 /dev/input/js0

At least they are what udev rules tell they should be:
Code:
$ grep event /lib/udev/rules.d/* | grep MODE
/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="input", KERNEL=="mouse*|mice|event*", MODE="0640"
$ grep js /lib/udev/rules.d/* | grep MODE
/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0644"


Now I wonder if the problem is in udev, ConsoleKit or systemD. Please help.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1131

PostPosted: Thu Feb 21, 2013 1:43 pm    Post subject: Re: Wrong device permissions Reply with quote

V10lator wrote:
I have to do this after every reboot.
Why don't you

cp /lib/udev/rules.d/50-udev-default.rules /etc/udev/rules.d/50-udev-default.rules
edit /etc/udev/rules.d/50-udev-default.rules

You own rules file at /etc/udev/rules.d should over rule the distribution rules file as long as it has the exact same name. That is what /etc is about: Its your root-administrator playground.
_________________
fun2gen2
Back to top
View user's profile Send private message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 166

PostPosted: Thu Feb 21, 2013 1:50 pm    Post subject: Reply with quote

And what exactly to change there when it seems to get ignored anyway?

//EDIT: Just to confirm that it's ignored I did what you told and changed the input handling:
Code:
# input
SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
SUBSYSTEM=="input", KERNEL=="mouse*|mice", MODE="0640"
SUBSYSTEM=="input", KERNEL=="event*", MODE="0666"
SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", GROUP="uinput", MODE="0660"
SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0666"

Curiously the uinput change is ignored:
Code:
$ ls -l /dev/uinput
crw------- 1 root root 10, 223 21. Feb 14:57 /dev/uinput

While the event/js change seems to work:
Code:
$ ls -l /dev/input/event6 /dev/input/js0
crw-rw-rw- 1 root root 13, 70 21. Feb 15:00 /dev/input/event6
crw-rw-rw- 1 root root 13,  0 21. Feb 15:00 /dev/input/js0


Last edited by V10lator on Thu Feb 21, 2013 2:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Feb 21, 2013 1:59 pm    Post subject: Reply with quote

So create a udev rule that works. Google "udev debugging".

To get you started:
Code:
udevadm info -a --name /dev/uinput
Back to top
View user's profile Send private message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 166

PostPosted: Thu Feb 21, 2013 2:06 pm    Post subject: Reply with quote

PaulBredbury wrote:
To get you started:
Code:
udevadm info -a --name /dev/uinput

Thanks a lot! /dev/uinput is a subsystem of misc, not input. That fixed it! :D

I guess this is a bug, but is it a gentoo or upstream bug? Also I'm curious if there are better solutions available and/or if the whole thing is a bug (a joystick should work out of the box, shouldn't it?).
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1131

PostPosted: Fri Feb 22, 2013 2:04 pm    Post subject: Reply with quote

If you get help you are supposed to help:
https://bugs.gentoo.org

... if you have reason to think you have found a bug.
Developers are not that often gamers. Joysticks might have been forgotten at some point ...
_________________
fun2gen2
Back to top
View user's profile Send private message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 166

PostPosted: Fri Feb 22, 2013 2:18 pm    Post subject: Reply with quote

ulenrich wrote:
If you get help you are supposed to help

Sure, but I don't want to annoy gentoo devs with upstream bugs, that's why I asked if anybody knows if this is a gentoo or a upstream bug. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum