Repository navigation
Fix the Olimex udev rules: drop the 0x prefix - #301
Merged
Merged
Conversation
udev compares ATTRS{idVendor} and ATTRS{idProduct} as strings
against the sysfs values, which are four lowercase hex digits
without a prefix (15ba, 002a). The Olimex lines were written as
"0x15ba" and "0x002a", so they never matched and those adapters
got neither the plugdev group nor the uaccess tag.
Checked with udevadm test (udev 257) on a USB device: the rule with
plain IDs matched, the same rule with 0x-prefixed IDs did not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The four Olimex lines in
public/files/69-probe-rs.ruleswrite the IDs as"0x15ba","0x0003"and so on. udev comparesATTRS{idVendor}andATTRS{idProduct}as strings against the sysfs values, which are four lowercase hex digits without a prefix (/sys/bus/usb/devices/*/idVendorholds15ba), so these rules never match, and ARM-USB-OCD, ARM-USB-TINY, ARM-USB-TINY-H and ARM-USB-OCD-H users get neither theplugdevgroup nor theuaccesstag from this file. Every other line in the file already uses the plain form.I checked the matching with
udevadm test(udev 257, Debian trixie) against a USB root hub (1d6b:0002): a rule withATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0002"matched, and the same rule with"0x1d6b"and"0x0002"did not.The lines have had the prefix since they were added in #113, and #200 carries them over unchanged. This PR only touches those four lines, so it does not overlap with #293.
I do not have an Olimex adapter here, so this is verified against udev's matching, not against the hardware.