2

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?

  • 3
    No, the man page is pretty clear - you can only assign a network interface name e.g. ATTR{address}=="08:00:01:de:b1:0a", NAME="eth1". – don_crissti Mar 16 '16 at 12:04
  • It's clear once you know that device nodes are completely different from network interfaces :-). E.g. you can have an ethernet network interface eth0 that shows up in ifconfig / ip link, and you will have no device node, no /dev/eth0 or anything else. – sourcejedi Feb 04 '19 at 16:24

0 Answers0