I have a four-port USB hub and four USB/serial adaptors. I want to ensure that the adaptor in port 0 is always called 'ttyUSB0' and so on.
udev will not allow device renames, with a rule such as:
KERNEL=="ttyUSB*", KERNELS=="1-1.4", NAME="ttyCOM3"
I get:
NAME="ttyUSB3" ignored, kernel device nodes can not be renamed; please fix it in /etc/udev/rules.d/00-ttyUSB.rules:3
a symlink is allowed, with a rule such as:
KERNEL=="ttyUSB*", KERNELS=="1-1.4", SYMLINK+="ttyCOM3"
resulting in:
/etc/udev/rules.d# ls -al /dev/ttyUSB0 /dev/ttyCOM*
lrwxrwxrwx 1 root root 7 Oct 7 11:22 /dev/ttyCOM3 -> ttyUSB0
crw-rw---- 1 root dialout 188, 0 Oct 7 11:22 /dev/ttyUSB0
the udev manual says "See systemd.link(5) for a higher-level mechanism for setting the interface name. The name of a device node cannot be changed by udev"
but this seems to only refer to network interfaces.
Is it possible to configure systemd (or some other layer) to create the ttyUSB[0123] nodes the way I want?
Thanks,
systemd
butudev
rules. Check therelated
links shown at the right – Serge Oct 07 '16 at 14:08udev
. – Serge Oct 09 '16 at 16:41