Re: matching udev attribute keys
On Sun, 26 Dec 2010 15:58:08 -0800, briand wrote:
> how do I know that "SerialNumber" is a valid udev key other than the
> fact that it is listed in dmesg when the device is plugged in.
(...)
Available information for the sysfs attributes can be fetched (if
present):
http://reactivated.net/writing_udev_rules.html#sysfstree
For what I see, this means that you can use both ("sysfstree" attribute
values and "udevinfo" ones) for writing rules, just ensure the attribute
you are going to use is present in one of the locations from where udev
gathers the data.
For instance, my USB key has at least one "ATTRS{serial}" value:
sm01@stt008:~$ udevinfo -a -p /sys/block/sdc | grep serial
ATTRS{serial}=="0000:00:1a.7"
But not my internal hard disks, neither from udevinfo:
sm01@stt008:~$ udevinfo -a -p /sys/block/sda | grep serial
sm01@stt008:~$ udevinfo -a -p /sys/block/sdb | grep serial
sm01@stt008:~$
Nor from sysfs:
sm01@stt008:~$ ls -l /sys/block/sda | grep -i serial
sm01@stt008:~$ ls -l /sys/block/sdb | grep -i serial
sm01@stt008:~$
Greetings,
--
Camaleón
Reply to: