Skip to content

Commit

Permalink
config: use correct udev rule ordering, drop non-portable MODE and …
Browse files Browse the repository at this point in the history
…`GROUP`.

The existing solution with `GROUP="plugdev"`, `MODE="0660"` is Debian
specific, and generally such groups are discouraged on modern Linux
desktop systems. There is no group for "USB development tool" and we
don't want to create one, but `TAG+="uaccess"` works fine for this.

We already had `TAG+="uaccess"` but due to a rule ordering issue it did
nothing. Move rules from `99-*.rules` to `70-*.rules` to fix this issue
and have the tag assign the right ACL on ~most modern Linux desktop
systems.

Fixes #441.
  • Loading branch information
whitequark committed Oct 18, 2023
1 parent 4709aa5 commit 459762b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions config/99-cypress.rules → config/70-cypress.rules
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
SUBSYSTEM=="usb", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="8613", \
MODE="0660", GROUP="plugdev", TAG+="uaccess"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="8613", TAG+="uaccess"
3 changes: 1 addition & 2 deletions config/99-glasgow.rules → config/70-glasgow.rules
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
SUBSYSTEM=="usb", ATTRS{idVendor}=="20b7", ATTRS{idProduct}=="9db1", \
MODE="0660", GROUP="plugdev", TAG+="uaccess"
SUBSYSTEM=="usb", ATTRS{idVendor}=="20b7", ATTRS{idProduct}=="9db1", TAG+="uaccess"
6 changes: 3 additions & 3 deletions docs/manual/src/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ Any board that is being factory flashed must have a blank ``FX2_MEM`` EEPROM. If

.. tab:: Linux

Configure your system to allow unprivileged access (for anyone in the ``plugdev`` group) to any hardware that enumerates as the Cypress FX2 ROM bootloader:
Configure your system to allow unprivileged access for anyone logged in to the physical terminal to any hardware that enumerates as the Cypress FX2 ROM bootloader:

.. code:: console
$ sudo cp config/99-cypress.rules /etc/udev/rules.d
$ sudo cp config/70-cypress.rules /etc/udev/rules.d
$ sudo udevadm control --reload
$ sudo udevadm trigger -v -c add -s usb -a idVendor=04b4 -a idProduct=8613
Note that this rule will allow unprivileged access to any device based on the Cypress FX2 that has a blank EEPROM, and not just the Glasgow.
Note that this rule will allow unprivileged access to any device based on the Cypress FX2 that has a blank EEPROM, and not just the Glasgow hardware specifically.

Plug in the newly assembled device. At this point, ``lsusb -d 04b4:8613`` should list one entry. Note the revision of the board you are factory flashing. If the board has revision ``C3``, run:

Expand Down
4 changes: 2 additions & 2 deletions docs/manual/src/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ If these instructions don't work for you, please `file a bug <file-a-bug_>`__ so
$ git clone https://github.com/GlasgowEmbedded/glasgow
Configure your system to allow unprivileged access (for anyone in the ``plugdev`` group) to the Glasgow hardware and apply the rules to any devices that are already plugged in:
Configure your system to allow access to the Glasgow hardware for anyone logged in to the physical terminal, and apply the rules to any devices that are already plugged in:

.. code:: console
$ sudo cp glasgow/config/99-glasgow.rules /etc/udev/rules.d
$ sudo cp glasgow/config/70-glasgow.rules /etc/udev/rules.d
$ sudo udevadm control --reload
$ sudo udevadm trigger -v -c add -s usb -a idVendor=20b7 -a idProduct=9db1
Expand Down

0 comments on commit 459762b

Please sign in to comment.