LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-02-2015, 05:05 AM   #1
mr.simo
Member
 
Registered: Feb 2010
Posts: 78

Rep: Reputation: 0
udev - dirctive NAME doesn't work


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
 
Old 10-02-2015, 05:33 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,803

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
This might answer your question

http://askubuntu.com/questions/54610...-from-12-04-to
 
1 members found this post helpful.
Old 10-02-2015, 06:01 AM   #3
mr.simo
Member
 
Registered: Feb 2010
Posts: 78

Original Poster
Rep: Reputation: 0
Ops, yes. The link provides useful information. Thank you.

So there is no way to make udev name the device ttyUSB0 as usbS1, without using a symlink ?
I can't believe it's not..
 
Old 10-02-2015, 04:19 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,803

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Well, udev has changed a fair bit since it was first implemented. The man page is pretty clear about it though
Quote:
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.
So, for other types of device nodes symlinks are the only possibility.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Udev doesn't create symlink Mate12345 Linux - Software 2 05-06-2015 02:16 AM
Keyboard doesn't work right click on mouse doesn't work ramblinrick Linux Mint 2 10-15-2010 01:10 AM
udev RUN+= doesn't seem to work PlancksCnst Linux - General 18 05-15-2007 06:44 PM
FC5 doesn't boot at 'udev' thelonius Fedora 4 08-04-2006 09:00 AM
udev rules all_partitions doesn't work arubin Slackware 1 06-10-2006 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration