Skip to content

Instantly share code, notes, and snippets.

@projectgus
Created April 28, 2023 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save projectgus/bba6e161d5b0bd72e6148427bc6d5e68 to your computer and use it in GitHub Desktop.
Save projectgus/bba6e161d5b0bd72e6148427bc6d5e68 to your computer and use it in GitHub Desktop.
udev rule to create symlinks /dev/serial/usb/VID:PID for usb serial devices
# Create a /dev/serial/usb/VID:PID symlink for each usb serial device
#
# - Kernel will manage multiple devices with the same VID:PID so the symlink points to the latest attached (I think).
# - Doesn't handle devices with >1 port, looks like it links the first one(?). /dev/serial/by-id probably better for that.
SUBSYSTEMS=="tty", ENV{ID_BUS}=="usb", SYMLINK+="serial/usb/$env{ID_USB_VENDOR_ID}:$env{ID_USB_MODEL_ID}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment