improve documentation for udev rule files on Linux #276

Merged
Be-ing merged 6 commits from udev into master 2021-05-20 17:04:08 -05:00
Be-ing commented 2021-05-17 18:13:29 -05:00 (Migrated from github.com)

Refer to the commit messages for details.

Refer to the commit messages for details.
Youw (Migrated from github.com) reviewed 2021-05-17 18:29:58 -05:00
Youw (Migrated from github.com) left a comment

Lets keep .rules sample unser udev/ where it was.

Lets keep .rules sample unser `udev/` where it was.
Youw (Migrated from github.com) commented 2021-05-17 18:16:05 -05:00

since this is an example, lets have an alternative example, where GROUP + MODE is used instead of 'uaccess', which is commonly known among community

since this is an example, lets have an alternative example, where GROUP + MODE is used instead of 'uaccess', which is commonly known among community
Youw (Migrated from github.com) commented 2021-05-17 18:20:42 -05:00

don't see where Busnum is referenced/used

don't see where `Busnum` is referenced/used
@ -47,6 +47,11 @@ HIDAPI has five back-ends:
On Linux, either the hidraw or the libusb back-end can be used. There are
Youw (Migrated from github.com) commented 2021-05-17 18:22:23 -05:00
to the [69-hid-udev.rules](69-hid-udev.rules) file for an example.
```suggestion to the [69-hid-udev.rules](69-hid-udev.rules) file for an example. ```
Be-ing (Migrated from github.com) reviewed 2021-05-17 18:40:36 -05:00
Be-ing (Migrated from github.com) commented 2021-05-17 18:40:36 -05:00

That is not a good solution because it requires explaining to (human) users that they need to add their user account to a specially named group which may vary depending on the application or distribution. This is an annoying user support burden. I know from experience. TAG+="uaccess" does not have this problem.

That is not a good solution because it requires explaining to (human) users that they need to add their user account to a specially named group which may vary depending on the application or distribution. This is an annoying user support burden. I know from experience. `TAG+="uaccess"` does not have this problem.
Be-ing (Migrated from github.com) reviewed 2021-05-17 18:40:56 -05:00
Be-ing (Migrated from github.com) commented 2021-05-17 18:40:56 -05:00

oh, I removed it, but not from the comment. Good catch

oh, I removed it, but not from the comment. Good catch
Youw (Migrated from github.com) reviewed 2021-05-17 18:56:32 -05:00
Youw (Migrated from github.com) commented 2021-05-17 18:56:32 -05:00

I'm not saying this is a bad solution. For some scenarios it is a great solution. But other than that there is no other reasons to limit users from available options.

Apparently you don't need to run unit-tests for your software from CI over SSH, using a real device connected to the build machine, where access to the device is expected exclusively from a remote session.
Having access setup for a specific USER/GROUP is a great solution for that case too.

I'm not saying this is a bad solution. For some scenarios it is a great solution. But other than that there is no other reasons to limit users from available options. Apparently you don't need to run unit-tests for your software from CI over SSH, using a real device connected to the build machine, where access to the device is expected exclusively from a remote session. Having access setup for a specific USER/GROUP is a great solution for that case too.
Be-ing (Migrated from github.com) reviewed 2021-05-17 19:05:01 -05:00
Be-ing (Migrated from github.com) commented 2021-05-17 19:05:00 -05:00

Does anyone actually do that?

Does anyone actually do that?
Youw (Migrated from github.com) reviewed 2021-05-17 19:09:18 -05:00
Youw (Migrated from github.com) commented 2021-05-17 19:09:18 -05:00

At least one suck user for your service.

At least one suck user for your service.
Be-ing (Migrated from github.com) reviewed 2021-05-17 19:24:15 -05:00
Be-ing (Migrated from github.com) commented 2021-05-17 19:24:15 -05:00

Okay, I added a comment to the end of the file.

Okay, I added a comment to the end of the file.
Youw (Migrated from github.com) approved these changes 2021-05-20 16:59:56 -05:00
tresf (Migrated from github.com) reviewed 2021-08-19 11:21:56 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
tresf (Migrated from github.com) commented 2021-08-19 11:21:56 -05:00

@Be-ing I hope you do not mind the tag. Can you help explain the following:

that these rules must have priorty before 70-uaccess.rules

@Be-ing I hope you do not mind the tag. Can you help explain the following: > that these rules must have priorty before `70-uaccess.rules`
Be-ing (Migrated from github.com) reviewed 2021-08-19 11:24:35 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
Be-ing (Migrated from github.com) commented 2021-08-19 11:24:34 -05:00

I don't recall the reason for this. I'm not sure we ever dug deep to figure out exactly what the issue was, but IIRC we stumbled on this shipping the udev rule file for Mixxx.

I don't recall the reason for this. I'm not sure we ever dug deep to figure out exactly what the issue was, but IIRC we stumbled on this shipping the udev rule file for Mixxx.
Be-ing (Migrated from github.com) reviewed 2021-08-19 20:31:49 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
Be-ing (Migrated from github.com) commented 2021-08-19 20:31:49 -05:00

If you figure this out, it would be great if you open a pull request to clarify the documentation in this example udev rule file.

If you figure this out, it would be great if you open a pull request to clarify the documentation in this example udev rule file.
tresf (Migrated from github.com) reviewed 2021-08-19 22:54:25 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
tresf (Migrated from github.com) commented 2021-08-19 22:54:24 -05:00

I've been having problems using the hidraw in general so I came here more as a "what am I doing wrong" step. I'll surely improve if I get further. 🍺

I've been having problems using the `hidraw` in general so I came here more as a "what am I doing wrong" step. I'll surely improve if I get further. 🍺
Be-ing (Migrated from github.com) reviewed 2021-08-19 23:01:54 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
Be-ing (Migrated from github.com) commented 2021-08-19 23:01:54 -05:00

Is this for LMMS?

Is this for LMMS?
tresf (Migrated from github.com) reviewed 2021-08-19 23:26:41 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
tresf (Migrated from github.com) commented 2021-08-19 23:26:41 -05:00

It's actually for another project (QZ Tray), which uses hidapi through hid4java.

It's actually for another project (QZ Tray), which uses hidapi through hid4java.
Youw (Migrated from github.com) reviewed 2021-08-21 15:04:05 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
Youw (Migrated from github.com) commented 2021-08-21 15:04:05 -05:00

Can you help explain the following:

that these rules must have priorty before 70-uaccess.rules

I'm pretty sure it is bacause of the use of TAG+="uaccess" - this tag is handled by the 70-uaccess.rules file (not exactly - my comment below), and all the rule files are processed in strict order, and if the tag is added after 70-uaccess.rules is processed - the device will be processed as if this tag is not present at all.

> Can you help explain the following: >>that these rules must have priorty before `70-uaccess.rules` I'm pretty sure it is bacause of the use of `TAG+="uaccess"` - this tag is handled by the ~`70-uaccess.rules` file~ (not exactly - my comment below), and all the rule files are processed in strict order, and if the tag is added _after_ ~`70-uaccess.rules`~ is processed - the device will be processed as if this tag is not present at all.
tresf (Migrated from github.com) reviewed 2021-08-23 11:34:26 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
tresf (Migrated from github.com) commented 2021-08-23 11:34:26 -05:00

@Youw thanks for the tip... I stumbled upon this bug report which seems to state something similar.
https://github.com/systemd/systemd/issues/4288#issuecomment-348166161

@Youw thanks for the tip... I stumbled upon this bug report which seems to state something similar. https://github.com/systemd/systemd/issues/4288#issuecomment-348166161
Youw (Migrated from github.com) reviewed 2021-08-23 12:30:28 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
Youw (Migrated from github.com) commented 2021-08-23 12:30:28 -05:00

Aha, so I haven't actually looked up the documentation for 70-uaccess.rules, I just assumed its purpose based on the documentation as suggested by this PR.
Thanks for pointing out to that comment. It appears my assumption is absolutely correct, but regarding a different file: 73-seat-late.rules.

I'll update a documentation once again.

Aha, so I haven't actually looked up the documentation for `70-uaccess.rules`, I just assumed its purpose based on the documentation as suggested by this PR. Thanks for pointing out to that comment. It appears my assumption is absolutely correct, but regarding a different file: `73-seat-late.rules`. I'll update a documentation once again.
Youw (Migrated from github.com) reviewed 2021-08-23 12:34:49 -05:00
@ -0,0 +16,4 @@
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess"
# Once done, optionally rename this file for your application, and drop it into
# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules
Youw (Migrated from github.com) commented 2021-08-23 12:34:49 -05:00

On that note: it looks like 70-uaccess.rules just automatically adds the uaccess tag to a few known devices/device types.

On that note: it looks like [`70-uaccess.rules`](https://cgit.freedesktop.org/systemd/systemd/tree/src/login/70-uaccess.rules) just automatically adds the `uaccess` tag to a few known devices/device types.
Be-ing commented 2021-08-24 18:43:32 -05:00 (Migrated from github.com)

Tangentially related: I requested a means for sandboxed applications to access HID devices without installing a udev rule file.

Tangentially related: I requested a means for [sandboxed applications to access HID devices](https://github.com/systemd/systemd/issues/20533) without installing a udev rule file.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!276
No description provided.