From f7b2607db25a6e1c0f56f90ff2d89d3874b73b41 Mon Sep 17 00:00:00 2001 From: Celeste Liu Date: Wed, 8 Oct 2025 22:32:43 +0800 Subject: [PATCH] udev: use ENV{ID_DEBUG_APPLIANCE} instead of GROUP and direct uaccess GROUP can't be used for * It's not concrete. All users in plugdev groups can use all devices in plugdev group, whatever it's phone, camera, microphone or debugprobe. * It's not flexible. The user list need be maintained manually. And if update, user need to re-login to take effect. * It doesn't work on modern Linux distros. On modern Linux world, only Debian and its derived distros have plugdev group by default. Arch, Fedora and Gentoo have no plugdev group by default at all. And systemd have a behavior: if the group declared in GROUP="" doesn't exist (since udev v174 released 2011 and systemd v183 released in 2012) or isn't system group (since v258 released in 2025), it will ignore the whole udev rule line (not only the chown operation).So our rule won't work on most modern Linux. uaccess mechanism has been introduced since systemd v30, which is released in 2011 (systemd sync version number with udev since v183 so there is a jump from v44 to v183 in 2012), so we can assume modern Linux with systemd always has this feature. Direct uaccess rule shouldn't be used because according to the post of systemd developer[1], the generic device class should be used instead. Although systemd has ID_DEBUG_APPLIANCE generic device class, we can't use it directly because it was introduced in v258. So I used a trick: add a our own rule to check ENV{ID_DEBUG_APPLIANCE}=="on_chip_debugger". So if systemd has ID_DEBUG_APPLIANCE, it do a reduntant thing, but since the operation is same, it's idempotent so it's safe; if systemd has no ID_DEBUG_APPLIANCE, this rule will set it to uaccess and doesn't affect other rules. The hint of probe-rs main program also need to be updated, to fix the issue mentioned in [2]. [1]: https://lists.freedesktop.org/archives/systemd-devel/2012-March/004792.html [2]: https://github.com/probe-rs/probe-rs/pull/3577 Signed-off-by: Celeste Liu --- public/files/69-probe-rs.rules | 223 +++++++++--------- .../docs/getting-started/probe-setup.mdx | 16 +- 2 files changed, 118 insertions(+), 121 deletions(-) diff --git a/public/files/69-probe-rs.rules b/public/files/69-probe-rs.rules index 599d1dd..993f736 100644 --- a/public/files/69-probe-rs.rules +++ b/public/files/69-probe-rs.rules @@ -9,139 +9,144 @@ ACTION!="add|change", GOTO="probe_rs_rules_end" -SUBSYSTEM=="gpio", MODE="0660", GROUP="plugdev", TAG+="uaccess" +SUBSYSTEM=="gpio", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" SUBSYSTEM!="usb|tty|hidraw", GOTO="probe_rs_rules_end" # Please keep this list sorted by VID:PID # STMicroelectronics ST-LINK V1 -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # STMicroelectronics ST-LINK/V2 -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # STMicroelectronics ST-LINK/V2.1 -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # STMicroelectronics STLINK-V3 -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374d", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3754", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374d", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3754", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # SEGGER J-Link -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1002", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1003", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1004", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1005", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1006", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1007", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1008", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1009", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100a", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100b", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100c", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100d", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100e", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100f", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1019", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101a", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101b", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101c", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101d", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101e", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101f", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1020", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1021", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1022", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1023", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1024", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1025", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1026", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1027", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1028", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1029", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102a", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102b", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102c", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102d", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102e", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102f", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1050", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1051", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1052", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1053", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1054", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1055", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1056", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1057", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1058", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1059", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105a", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105b", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105c", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105d", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105e", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105f", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1060", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1061", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1062", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1063", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1064", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1065", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1066", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1067", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1068", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1069", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106a", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106b", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106c", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106d", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106e", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106f", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1001", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1002", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1003", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1004", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1005", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1006", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1007", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1008", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1009", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100a", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100b", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100c", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100d", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100e", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="100f", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1019", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101a", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101b", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101c", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101d", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101e", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="101f", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1020", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1021", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1022", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1023", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1024", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1025", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1026", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1027", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1028", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1029", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102a", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102b", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102c", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102d", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102e", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="102f", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1050", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1051", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1052", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1053", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1054", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1055", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1056", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1057", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1058", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1059", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105a", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105b", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105c", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105d", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105e", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="105f", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1060", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1061", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1062", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1063", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1064", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1065", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1066", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1067", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1068", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1069", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106a", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106b", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106c", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106d", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106e", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="106f", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # FT232H -ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # FT2232x -ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # FT4232H -ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # FTDI-based Olimex devices -ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x0003", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x0004", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x002a", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x002b", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x0003", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x0004", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x002a", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="0x15ba", ATTRS{idProduct}=="0x002b", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # Espressif USB JTAG/serial debug unit -ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # Espressif USB Bridge -ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1002", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1002", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # CMSIS-DAP compatible adapters -ATTRS{product}=="*CMSIS-DAP*", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{product}=="*CMSIS-DAP*", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" # WCH Link (CMSIS-DAP compatible adapter) -ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="8010", MODE="660", GROUP="plugdev", TAG+="uaccess" -ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="8011", MODE="660", GROUP="plugdev", TAG+="uaccess" +ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="8010", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" +ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="8011", ENV{ID_DEBUG_APPLIANCE}="on_chip_debugger" -LABEL="probe_rs_rules_end" \ No newline at end of file +# TODO: For compatible with systemd < v258 +ENV{ID_DEBUG_APPLIANCE}=="on_chip_debugger", TAG+="uaccess" +# If you want to use probe-rs with SSH-login user session, uncomment line below, and replace grpname with what you want. +#ENV{ID_DEBUG_APPLIANCE}=="on_chip_debugger", MODE="0660", GROUP="grpname" + +LABEL="probe_rs_rules_end" diff --git a/src/content/docs/getting-started/probe-setup.mdx b/src/content/docs/getting-started/probe-setup.mdx index 203db56..a6a4c08 100644 --- a/src/content/docs/getting-started/probe-setup.mdx +++ b/src/content/docs/getting-started/probe-setup.mdx @@ -19,20 +19,12 @@ users without root privileges access to the debug probes as well. 1. Download the rules file and place it in /etc/udev/rules.d. -2. Run `udevadm control --reload` to ensure the new rules are used. -3. Run `udevadm trigger` to ensure the new rules are applied to already added +2. If you want to use probe-rs in SSH session, please see the comment at the end of udev rule and + and modify it according to it. +3. Run `udevadm control --reload` to ensure the new rules are used. +4. Run `udevadm trigger` to ensure the new rules are applied to already added devices. -If you're still unable to access the debug probes after following these steps, -try adding your user to the plugdev group. This group needs to be a system group -if you use systemd version higher than v258. In this case you can try the following -commands to fix the udev rules : - -```bash -sudo groupadd --system plugdev -sudo usermod -a -G plugdev $USER -``` - [^1]: The file needs to have an initial number lower than 73, otherwise the udev rules do not get applied properly. See [this Github discussion](https://github.com/systemd/systemd/issues/4288#issuecomment-348166161)