Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev REFUSES to rename /dev/ttyUSB0 to /dev/ttyScope
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
brainsalad
n00b
n00b


Joined: 01 Sep 2010
Posts: 6

PostPosted: Fri Mar 07, 2014 4:48 pm    Post subject: udev REFUSES to rename /dev/ttyUSB0 to /dev/ttyScope Reply with quote

This line in /etc/udev/rules.d/99-scope-and-lightbox-serial-interfaces.rules used to work:

SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{product}=="USB <-> Serial", ATTRS{manufacturer}=="FTDI", ATTRS{idVendor}=="0403", NAME="ttyScope"

With udev 197, this rule stopped working. Udev does continue to match the device correctly: changing NAME to SYMLINK results in a symlink being created. But udev won't rename the device. It just won't do it. I will not abide this. THIS CAN NOT STAND!!!!!!!!!!!!!

The problem does not appear to be other udev rules interfering. I know this because I tried deleting them all. Nope. Still /dev/ttyUSB0.

This has been sticking in my craw for too long, now. I will tear the world in half and hurl the moon into the sun at noon CST Monday if I do not have this figured out by then. All life in this solar system will be terminated, forever. Ok, so I hope someone has a workaround. Don't make me do it.
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Fri Mar 07, 2014 4:56 pm    Post subject: Re: udev REFUSES to rename /dev/ttyUSB0 to /dev/ttyScope Reply with quote

brainsalad wrote:
This line in /etc/udev/rules.d/99-scope-and-lightbox-serial-interfaces.rules used to work:

SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{product}=="USB <-> Serial", ATTRS{manufacturer}=="FTDI", ATTRS{idVendor}=="0403", NAME="ttyScope"

With udev 197, this rule stopped working. Udev does continue to match the device correctly: changing NAME to SYMLINK results in a symlink being created. But udev won't rename the device. It just won't do it. I will not abide this. THIS CAN NOT STAND!!!!!!!!!!!!!

The problem does not appear to be other udev rules interfering. I know this because I tried deleting them all. Nope. Still /dev/ttyUSB0.

This has been sticking in my craw for too long, now. I will tear the world in half and hurl the moon into the sun at noon CST Monday if I do not have this figured out by then. All life in this solar system will be terminated, forever. Ok, so I hope someone has a workaround. Don't make me do it.


DRIVERS=="usb" looks wrong. I'm not sure about using SUBSYSTEMS=="usb" either. Try something like this?

SUBSYSTEMS=="usb-serial", ATTRS{manufacturer}=="FTDI", ATTRS{idVendor}=="0403", NAME="ttyScope"
Back to top
View user's profile Send private message
brainsalad
n00b
n00b


Joined: 01 Sep 2010
Posts: 6

PostPosted: Fri Mar 07, 2014 5:27 pm    Post subject: Re: udev REFUSES to rename /dev/ttyUSB0 to /dev/ttyScope Reply with quote

ssuominen wrote:

DRIVERS=="usb" looks wrong. I'm not sure about using SUBSYSTEMS=="usb" either. Try something like this?

SUBSYSTEMS=="usb-serial", ATTRS{manufacturer}=="FTDI", ATTRS{idVendor}=="0403", NAME="ttyScope"


Thanks; I tried that line and some variations. With SUBSYSTEMS=="usb" and SYMLINK+="ttyScope" a symlink is created.

Along the way, I finally spotted a key bit of info in dmesg:

Code:
[ 3654.304317] udevd[21230]: NAME="ttyScope" ignored, kernel device nodes can not be renamed; please fix it in /etc/udev/rules.d/99-scope-and-lightbox-serial-interfaces.rules:8


Ah ha! "Kernel device nodes can not be renamed," eh? Ok, udev. Let's trust but verify:

Code:
# ls -l /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0 Mar  7 11:09 /dev/ttyUSB0
# mv -v /dev/ttyUSB0 /dev/ttyScope
‘/dev/ttyUSB0’ -> ‘/dev/ttyScope’
# ls -l /dev/ttyUSB0
ls: cannot access /dev/ttyUSB0: No such file or directory
# ls -l /dev/ttyScope
crw-rw---- 1 root uucp 188, 0 Mar  7 11:09 /dev/ttyScope
# screen /dev/ttyScope 9600
45 45 45 11 16  (it works)


Udev lied to me. Udev is a fascist and won't let me do what I want because it thinks it knows better. Udev's source code is getting PATCHED to remove this scumbag restriction.
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Fri Mar 07, 2014 7:46 pm    Post subject: Reply with quote

Is there something wrong with symlinking it, instead of moving it? It sounds better to me. The symlink, that is.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6194

PostPosted: Sat Mar 08, 2014 2:44 am    Post subject: Reply with quote

First of all, this is really old news (pre-systemd merge, IIRC).

Also, most likely that restriction was put for a good reason - most likely to prevent races.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum