Hi,
I am trying to replace a
ttyUSB* to
usbS*, where * is a number between 0-2 so
ttyUSB0 → usbS0 and so on.
Applying udev rules I only accomplish to create a symlink with the SYMLINK="usbS*". For
ttyUSB0 → usbS0 it works with the following rule:
Code:
KERNELS=="1-2.1", SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK="usbS0"
But I don't want a symlink, I want to rename the device
This rule doesn't work:
Code:
KERNELS=="1-2.1", SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", NAME="usbS0"
neither this:
Code:
KERNEL="ttyUSB*", KERNELS=="1-2.1", SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", NAME="usbS0"
this also doesn't work:
Code:
KERNELS=="1-2.1", SUBSYSTEMS=="usb", SUBSYSTEM=="tty", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", NAME="usbS0"
and why not ...
Code:
KERNELS=="1-2.1", DRIVER=="ftdi_sio", SUBSYSTEMS=="usb", SUBSYSTEM=="tty", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", NAME="usbS0"
This is the information obtained with udevadm:
Code:
~$ udevadm info -q all /dev/ttyUSB0
P: /devices/68000000.ocp/48064000.usbhshost/48064800.ehci/usb1/1-2/1-2.1/1-2.1:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
S: usbS0
E: DEVLINKS=/dev/usbS0
E: DEVNAME=/dev/ttyUSB0
E: DEVPATH=/devices/68000000.ocp/48064000.usbhshost/48064800.ehci/usb1/1-2/1-2.1/1-2.1:1.0/ttyUSB0/tty/ttyUSB0
E: ID_BUS=usb
E: ID_MODEL=FT232R_USB_UART
E: ID_MODEL_ENC=FT232R\x20USB\x20UART
E: ID_MODEL_FROM_DATABASE=FT232 USB-Serial (UART) IC
E: ID_MODEL_ID=6001
E: ID_REVISION=0600
E: ID_SERIAL=FTDI_FT232R_USB_UART_A101XRTT
E: ID_SERIAL_SHORT=A101XRTT
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=324105
Seems obvious that the NAME directive is giving some problem.
Is there a way to accomplish it by an external script ?
I know I could use the RUN directive, but I think I could not remove ttyUSB0.
Is a good approach moving it manually? For example running:
Code:
mv /dev/ttyUSB0 /dev/usbS0
?
Hower, I have some rules files into /lib/udev/rules.d, I tried to grep 'ttyUSB':
Code:
~$ grep -rn 'ttyUSB' *
60-persistent-serial.rules:6:KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="persistent_serial_end"
But the first line of this file reports:
Code:
# do not edit this file, it will be overwritten on update
Thanks in advance,
Regards