Problem:
I'm writing persistent naming rules for a USB dongle following the tutorial here. The rule works as expected for :
SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="custom/ttyUSB-ZStick-5G"
This creates a symlink to the original device file /dev/ttyACM0
.
$ ls -la /dev/custom/ttyUSB-ZStick-5G
lrwxrwxrwx 1 root root 10 Mar 16 12:48 /dev/custom/ttyUSB-ZStick-5G -> ../ttyACM0
However, I need to have /dev/custom/ttyUSB-ZStick-5G
as a real device file not a symlink. To do that I've tried:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", NAME="custom/ttyUSB-ZStick-5G"
But this hasn't produced the correct result.
Reasearch and reference
Reading man udev
I can't conclude if this is possible:
The following keys can get values assigned:
NAME
The name to use for a network interface. The name of a device node cannot be changed by udev, only additional symlinks can be created.
First it stats that it can be assigned but disproves that in the next sentence.
Also, I've seen tutorials claiming that it's possible:
KERNEL=="hdb", NAME="my_spare_disk"
The above rule says: match a device which was named by the kernel as hdb, and instead of calling it hdb, name the device node as my_spare_disk. The device node appears at /dev/my_spare_disk.
Question:
Is it possible to have a custom device file name (not symlink) with a udev rule?
ATTR{address}=="08:00:01:de:b1:0a", NAME="eth1"
. – don_crissti Mar 16 '16 at 12:04eth0
that shows up inifconfig
/ip link
, and you will have no device node, no/dev/eth0
or anything else. – sourcejedi Feb 04 '19 at 16:24