Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev rules not matching
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
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Fri Oct 03, 2014 8:30 pm    Post subject: udev rules not matching Reply with quote

Hi,

I'm trying to add a new udev rule to rename a STM32 device. By default it gets a name like /dev/usbdev3.x , where x climbs by one each time I unplug and replug.

I used udevadm to find some ATTR values to catch the device when plugged in:

Code:
 udevadm info --attribute-walk --name=/dev/usbdev3.5


ATTR{product}=="STM32 STLink"

/etc/udev/rules.d/10-local.rules
Quote:
SUBSYSTEM=="usb", ATTR{product}=="STM32 STLink", NAME="STM32"



Code:
  udevadm trigger   


This is not changing anything. It still gets an incrementing device name on usbdev/3.x

It's probably some pedantic syntax error, can anyone point out what I'm missing?

TIA, Gentree. 8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Sat Oct 04, 2014 12:33 am    Post subject: Reply with quote

Perhaps I remember it wrong, but wasn't renaming nodes by udev deprecated, then removed quite awhile ago ?
Well, the first definitely happened, not sure about the second.
Isn't symlinking enough ?
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1694

PostPosted: Sat Oct 04, 2014 2:27 am    Post subject: Reply with quote

Well, I could say for sure; that renaming nodes was not removed; was I have to do it to get my sound to work in general. In my case symlinking doesn't help when my issue is more of which order my sound card is numbered; since pulse insists on wanting the first card as default. Just changing the the default card in pulse's config doesn't work (assuming you can find correct information for current version that works), not all applications outputs through pulse (they only retrieve the first card, and send to that only).
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sat Oct 04, 2014 12:37 pm    Post subject: Reply with quote

VoidMage wrote:
Perhaps I remember it wrong, but wasn't renaming nodes by udev deprecated, then removed quite awhile ago ?
Well, the first definitely happened, not sure about the second.
Isn't symlinking enough ?


How can you simlink when the damned device name changes every time you plug it in?

I have other rules that work on different ATTR and ATTRS variables for renaming my various NICs in human rememberable form. They all work fine.

I have the following rule to give a consisten name to an xd card I use in a 5:1 adapter, it works. Device appears and disappears according to whether it's plugged in.
Code:

ATTRS{model}=="USB xD/SM Reader"   NAME="xd", SYMLINK+="camera"



So why doesn't the new rule work?

BTW void' , if you think udev is deprecated , what replaced it?

thx.
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Sat Oct 04, 2014 1:44 pm    Post subject: Reply with quote

I didn't say "udev is deprecated", I've said "renaming nodes by udev deprecated" - that's a significant difference.
I was mostly referring to the change noted in the pre-systemd merge NEWS file under "udev 176".

As for that pulseaudio issue, for me setting the card in <machine-id>-default-{sink,source} worked just fine.
There's a simple setting to do similar for pure ALSA too.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sat Oct 04, 2014 3:20 pm    Post subject: Reply with quote

Code:
   
udevadm info --attribute-walk --name=/dev/usbdev3.4
....

 ATTR{idVendor}=="0483"
    ATTR{idProduct}=="3748"



I found this rule somewhere which does match:
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748",  MODE:="0664",  SYMLINK+="stlinkv2_%n"


Code:
84437 lrwxrwxrwx  1 root root            15 Oct  4 17:16 stlinkv2_1 -> bus/usb/003/005
84472 lrwxrwxrwx  1 root root             9 Oct  4 17:16 stlinkv2_5 -> usbdev3.5


I guess that's what you meant by "symlink" , thought you suggesting a manual ln -s

So the question is why does this rule work using ATTRS and not ATTR when udevadm tells me that these are ATTR attributes and they are NOT listed as ATTRS attributes?

:(


PS for the record, this works and sets the perms and group to what I wanted:


Code:

echo ' SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748",  MODE:="0664",  SYMLINK+="stlink", GROUP="usb"' \
 >> /etc/udev/rules.d/10-local.rules

_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
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