From 9ee969218cf7ea993fcd96989cbba7bdde3585b4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 15 Nov 2022 16:06:23 +0100 Subject: [PATCH] add README entry for udevadm usage --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index f68eb210..403189d6 100644 --- a/README.md +++ b/README.md @@ -1055,6 +1055,29 @@ Get fill count: xsc_scratch read | wc -c ``` +## Custom device names in Linux with the `udev` module + +You can assign custom device names using the Linux `udev` system. +This works by specifying a rules file inside the `/etc/udev/rules.d` folder +which creates a SYMLINK if certain device properties are true. + +Each rule is a new line inside a rules file. +For example, the rule + +```txt +SUBSYSTEM=="tty", ATTRS{interface}=="Dual RS232-HS", ATTRS{bInterfaceNumber}=="01", SYMLINK+="ploc_supv +``` + +Will create a symlink `/dev/ploc_supv` if a connected USB device has the +same `interface` and `bInterfaceNumber` properties as shown above. + +You can list the properties for a given connected device using `udevadm`. +For example, you can do this for a connected example device `/dev/ttyUSB0` +by using + +```txt +udevadm info -a /dev/ttyUSB0 +``` ## Using `system` when debugging