You are not logged in.

#1 2014-11-21 21:41:46

penright14
Member
Registered: 2014-11-20
Posts: 35

[SLOVED] Are udev rule attributes 'ATTRS' or 'ATTR' interchangeable?

Since I got my network@.service working by running it manualy, I was looking at why it was not starting at boot. The journalctl was reporting I had a bad rule in /etc/rules.d/10-network.rules. So I started looking at to understand udev better. I was using the network wiki https://wiki.archlinux.org/index.php/Ne … figuration Then I found the udev rule wiki https://wiki.archlinux.org/index.php/Udev

Looking at two different wiki the network one uses ATTR but the udev uses ATTRS. Also if I run udevadm info -a -p /sys/class/net/ens32 as in the example on the udev wiki, it reports as ATTRS
Should they be interchangeable?

Last edited by penright14 (2014-11-24 13:38:29)

Offline

#2 2014-11-21 22:06:45

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SLOVED] Are udev rule attributes 'ATTRS' or 'ATTR' interchangeable?

No - they have different meanings.

ATTRS will match on more levels.

"man udev" has a bad explanation sad

Offline

#3 2014-11-22 00:13:17

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [SLOVED] Are udev rule attributes 'ATTRS' or 'ATTR' interchangeable?

Reactivated as an example that might make it clearer.

Offline

#4 2014-11-24 13:38:08

penright14
Member
Registered: 2014-11-20
Posts: 35

Re: [SLOVED] Are udev rule attributes 'ATTRS' or 'ATTR' interchangeable?

Strike0 wrote:

Reactivated as an example that might make it clearer.

I know this may seem obvious (newbi), but where it says to use udevinfo on new systems 'udevadm info'

OK, Being new, I was missing the hierarchy. So by adding the S on ATTR and SUBSYSTEM that allows you to use the parent of the inherited process.

Offline

#5 2014-11-26 10:52:54

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [SLOVED] Are udev rule attributes 'ATTRS' or 'ATTR' interchangeable?

Yes, something like that (and udevinfo is deprecated indeed).
SUBSYSTEM picks the starting point in the device hierarchy. Then, going back to your original question: the network wiki can use ATTR to identify the correct device to apply the rule to, because the MAC is a unique ATTR for the device (it will match also if you plug the card into another slot/PC). The Udev wiki instead has a lot of example rules for devices which don't have such a unique persistent ATTR or rules which should be applied more generally. For example  this rule matches the devices based on ATTRS{idVendor} and ATTRS{idProduct}. This combo might actually match for more than one device (two usb-devices of the same make). Yet, it will match as well, if you plug the device into another usb-port.

Offline

Board footer

Powered by FluxBB