30 Jun 2012 19:15
udev: getting attributes from subdevice?
Clemens Ladisch <clemens <at> ladisch.de>
2012-06-30 17:15:26 GMT
2012-06-30 17:15:26 GMT
Hi,
I thought it would be useful to have persistent names for FireWire
devices:
########################################################################
ACTION=="remove", GOTO="persistent_firewire_end"
SUBSYSTEM!="firewire", GOTO="persistent_firewire_end"
TEST=="guid", SYMLINK+="firewire/by-id/guid-$attr{guid}"
TEST=="vendor_name", TEST=="model_name", \
OPTIONS="string_escape=replace", \
SYMLINK+="firewire/by-name/$attr{vendor_name} $attr{model_name}"
LABEL="persistent_firewire_end"
########################################################################
And these rules appear to work:
$ cat /sys/bus/firewire/devices/fw0/{vendor_name,model_name}
Linux Firewire
Juju
$ ls -l /dev/firewire/by-name/
lrwxrwxrwx 1 root root 9 2012-06-30 18:13 Linux_Firewire_Juju -> ../../fw0
However, there are devices where, due to some strange rules in the
FireWire specifications, some attributes end up belonging to a subdevice:
$ cat /sys/bus/firewire/devices/fw2/{vendor_name,model_name}
(Continue reading)
RSS Feed