Skip to content

Commit

Permalink
udev.rules documentation improvement (libusb#326)
Browse files Browse the repository at this point in the history
As recently discovered (thanks @tresf), the `TAG+="uaccess"` has to be used
before `73-seat-late.rules` and not before `70-uaccess.rules`.

Technically it doesn't harm to have a more restrictive recommenration,
but it was not technically correct.

Refference on `uaccess` TAG consumption:
[1](https://github.com/systemd/systemd/blob/3a1220eedfb65355c387c29584380742a21917aa/src/login/73-seat-late.rules.in), [2](https://www.apt-browse.org/browse/debian/wheezy/main/amd64/systemd/44-11+deb7u4/file/lib/udev/rules.d/73-seat-late.rules).
  • Loading branch information
Youw authored Sep 13, 2021
1 parent 11cc0e8 commit e9f8c3e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions udev/69-hid.rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uacce
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
# for example, name the file /etc/udev/rules.d/69-my-application-hid.rules.
# /etc/udev/rules.d/.
# NOTE: these rules must have priorty before 73-seat-late.rules.
# (Small discussion/explanation in systemd repo:
# https://github.com/systemd/systemd/issues/4288#issuecomment-348166161)
# for example, name the file /etc/udev/rules.d/70-my-application-hid.rules.
# Then, replug your device or run:
# sudo udevadm control --reload-rules && sudo udevadm trigger

# Note that the hexadecimal values for VID and PID are case sensitive and
# must be lower case.

# TAG+="uaccess" only gives permission to physically present users, which
# is appropriate in most scenarios. If you require remote access to the
# device, add
# is appropriate in most scenarios. If you require access to the device
# from a remote session (e.g. over SSH), add
# GROUP="plugdev", MODE="660"
# to the end of the udev rule lines, add your user to the plugdev group with:
# usermod -aG plugdev USERNAME
Expand Down

0 comments on commit e9f8c3e

Please sign in to comment.