udev: match Bluetooth HID devices (fixes #10) - #29
Open
cartermccann wants to merge 1 commit into
Open
Conversation
Configuring a Work Louder device over Bluetooth fails because every hidraw
rule matches on ATTRS{idVendor}, which walks up the device tree for a USB
parent carrying idVendor. A BLE (HID-over-GATT) device has no USB parent, so
those rules never match — the hidraw node stays root-only and node-hid gets
EACCES opening it.
Add rules that match the Bluetooth HID parent by kernel name instead:
bus 0005 = BUS_BLUETOOTH, with the VID in uppercase hex (0005:303A:*,
0005:574C:*), keeping the existing MODE/GROUP/uaccess form so both systemd
(uaccess) and non-systemd (group) setups get access.
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.
Fixes #10 (Bluetooth config not working)
Root cause
Every
hidrawrule ininstall-udev-worklouder.shmatches onATTRS{idVendor}=="303a"(and574c).ATTRS{...}walks up the devicetree looking for a parent that carries
idVendor— which only exists on aUSB device. A device connected over Bluetooth (HID-over-GATT) has no
USB parent in its chain (the parent is the Bluetooth stack,
BUS_BLUETOOTH),so those rules never match a BLE-connected device.
The result: the BLE
hidrawnode staysroot:root 0600, and the app'snode-hidfails to open it withEACCES— which surfaces as "Bluetoothconfig not working". (The current comment even lists "BLE HID" as covered by
the
ATTRS{idVendor}rule, which is the mistaken assumption.)Fix
Add two rules that match the Bluetooth HID parent by kernel name instead of
by USB vendor attribute. BLE HID devices are named
0005:VVVV:PPPP.NNNNby thekernel, where
0005=BUS_BLUETOOTHand the VID/PID are uppercase hex:They keep the same
MODE/GROUP/uaccessform as the existing USB rules, soboth systemd (
uaccess→ active-seat user) and non-systemd (GROUP) setups getaccess. The wired USB rules are unchanged.
Verification
Confirmed on a Codex Micro (
303A:8360) connected over Bluetooth, kernel6.12. Before:
node-hidopen on the BLE/dev/hidrawN→ permission denied.After adding the rule: the node's
uaccessACL is granted,node-hidopens it,and Input detects the device over Bluetooth.
The device's kernel HID name was
0005:303A:8360.xxxx, which the0005:303A:*rule matches directly.Scope note: verified on one BLE device (Codex Micro) on one machine. The
574Crule mirrors the existing USB Nomad rule; I don't have a BLE Nomad totest. The mechanism (
BUS_BLUETOOTHHID naming +uaccess) is standard, sothis should apply to all Work Louder BLE devices.
Follow-up (not in this PR)
Every rule in this file uses
MODE="0666"(world read/write). Sinceuaccessalready grants the active-seat user access via ACL, tightening the whole file to
MODE="0660"would be a reasonable hardening. Left out here to keep this focusedon #10 and consistent with the existing rules.