Skip to content

Instantly share code, notes, and snippets.

@ericwoud
Created November 4, 2022 19:02
Show Gist options
  • Select an option

  • Save ericwoud/d5d81853a71a3930c895cba09d0ec202 to your computer and use it in GitHub Desktop.

Select an option

Save ericwoud/d5d81853a71a3930c895cba09d0ec202 to your computer and use it in GitHub Desktop.
Create symlinks /dev/hidraw/by-id/xxxxx and /dev/hidraw/by-path/xxxxx for all hidraw devices
# /etc/udev/rules.d/79-hidraw-by-id-and-by-path.rules
# Create symlinks /dev/hidraw/by-id/xxxxx and /dev/hidraw/by-path/xxxxx
ACTION!="add", GOTO="hidraw-by-id-and-by-path-end"
SUBSYSTEM!="hidraw", GOTO="hidraw-by-id-by-path-end"
IMPORT{builtin}="usb_id"
ENV{ID_SERIAL}=="?*", SYMLINK+="hidraw/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
IMPORT{builtin}="path_id"
ENV{ID_PATH}=="?*", SYMLINK+="hidraw/by-path/$env{ID_PATH}"
LABEL="hidraw-by-id-and-by-path-end"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment