Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Testers wanted for centralized handling of /dev/rfkill
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
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Fri Mar 07, 2014 7:40 pm    Post subject: Testers wanted for centralized handling of /dev/rfkill Reply with quote

I sent this mail today to gentoo-dev mailing list, but you can answer me here too:

- sys-apps/systemd has it's own service to handle /dev/rfkill from
99-systemd.rules we don't install with sys-fs/udev:

SUBSYSTEM=="rfkill", TAG+="systemd", IMPORT{builtin}="path_id",
ENV{SYSTEMD_WANTS}+="systemd-rfkill@$name.service"

- so this is about sys-fs/udev (and perhaps, sys-auth/consolekit for ACLs)
- since the udev .rules are not application specific, we should control
it from sys-fs/udev's /lib/udev/rules.d/40-gentoo.rules
- sys-fs/udev leaves it to root:root as:

KERNEL=="rfkill", MODE="0664"

- third party packages like mate-bluetooth, gnome-bluetooth install both
their own udev .rules to adjust /dev/rfkill to plugdev:

KERNEL=="rfkill", GROUP="plugdev", MODE="0664"

So I'd like to propose some unification:

I don't have a system with /dev/rfkill unfortunately to test this, but I
believe we should add this to 40-gentoo.rules and create group 'rfkill':

SUBSYSTEM=="rfkill", GROUP="rfkill", MODE="0664"

And this line would go as /lib/udev/rules.d/70-gentoo-acl.rules (as the
original filename in upstream ConsoleKit is 70-udev-acl.rules):

SUBSYSTEM=="rfkill", TAG+="udev-acl"

So that it would then look like:

$ ls -ld /dev/rfkill
crw-rw----+ 1 root rfkill 116, 1 Feb 21 16:27 /dev/rfkill

Notice the "+" there for ACLs if user is active (logged in using
ConsoleKit):

$ getfacl -a /dev/rfkill
# file: dev/rfkill
# owner: root
# group: rfkill
user::rw-
user:ssuominen:rw-
group::rw-
mask::rw-
other::---

I didn't actually run that just on /dev/rfkill, but I took an example
from /dev/snd/seq, and edited those at this mail.

I'd like someone with /dev/rfkill to test I'm right, if possible, and
verify no other cruft is interfering with it (like those of installed by
those apps I mentioned, `grep rfkill /lib/udev/rules.d/*`)

Any thoughts?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Mar 07, 2014 8:11 pm    Post subject: Reply with quote

ssuominen asked me to comment, so might as well do it here.

Code:
$ udevadm info -a --name /dev/rfkill

  looking at device '/devices/virtual/misc/rfkill':
    KERNEL=="rfkill"
    SUBSYSTEM=="misc"
    DRIVER==""


So the comparison must be kept as: KERNEL=="rfkill"

Adding an "rfkill" group sounds reasonable.

(I don't use consolekit.)
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Fri Mar 07, 2014 8:13 pm    Post subject: Reply with quote

PaulBredbury wrote:
ssuominen asked me to comment, so might as well do it here.

Code:
$ udevadm info -a --name /dev/rfkill

  looking at device '/devices/virtual/misc/rfkill':
    KERNEL=="rfkill"
    SUBSYSTEM=="misc"
    DRIVER==""


So the comparison must be kept as: KERNEL=="rfkill"

Adding an "rfkill" group sounds reasonable.

(I don't use consolekit.)


Hmm, why is the 99-systemd.rules (the first rules line in my post) using SUBSYSTEM=="rfkill"? It's what confused me.

And thanks!
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Mar 07, 2014 10:06 pm    Post subject: Reply with quote

I'm using eudev (current git).

Arch use systemd, and have a udev rule in their rfkill pkg.
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Sat Mar 08, 2014 5:31 am    Post subject: Reply with quote

PaulBredbury wrote:
I'm using eudev (current git).

Arch use systemd, and have a udev rule in their rfkill pkg.


Yes, I've seen many use KERNEL=="rfkill" but since systemd introduced it's rfkill .service, I've seen indicators of SUBSYSTEM=="rfkill"

The eudev code is not the same as udev code in systemd, or recent as. A fact, not a flamebait to anyone. This line in the reply is only for Paul, so if anyone is thinking about replying to only this, don't. We are discussing about rfkill here.

Plus I don't trust that rule from ArchLinux to proof anything, it's most likely a relic from the past before rfkill .service was introduced.

Someone posted this on the ML:

Quote:

$ sudo udevadm info -q all --path /sys/class/rfkill/rfkill0
P: /devices/pci0000:00/0000:00:04.0/0000:02:00.0/usb8/8-2/8-2.2/8-2.2:1.0/bluetooth/hci0/rfkill0
E:
DEVPATH=/devices/pci0000:00/0000:00:04.0/0000:02:00.0/usb8/8-2/8-2.2/8-2.2:1.0/bluetooth/hci0/rfkill0
E: ID_PATH=pci-0000:02:00.0-usb-0:2.2:1.0 E:
ID_PATH_TAG=pci-0000_02_00_0-usb-0_2_2_1_0 E: RFKILL_NAME=hci0
E: RFKILL_STATE=1
E: RFKILL_TYPE=bluetooth
E: SUBSYSTEM=rfkill
E: SYSTEMD_WANTS=systemd-rfkill@rfkill0.service
E: TAGS=:systemd:
E: USEC_INITIALIZED=59720
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Mar 08, 2014 9:51 am    Post subject: Reply with quote

ssuominen wrote:
it's most likely a relic from the past


Possibly, but Arch use bleeding-edge systemd version. I dunno.

If KERNEL== works, and SUBSYSTEM== only works with the very latest versions, then you're better off sticking to KERNEL== for now, for compatibility ;)
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