Hi all. I have the following problem: I have this hardware that is a camera that export the SD content as mass storage. For now, what I need is to detect when the device is plugged and run a C program passing the serial and the device locations as parameters.
These are the data Im able to gather using

The %k stands for the device name on /dev (i.e /dev/sdd) and %s{serial} stands for the ATTRS{serial} given by udev
The C program is writing the parameters in a file so I can see the output, so when I plug only the right device (which contains the rule serial "3238204E6F76") it does runs the C program and create the /dev/camera_sdd symlink, so the matching rule is working.

For example, if I plug the camera and udev detects it as /dev/sdc, then the output would be:

Code:

a camera_sdc 3238204E6F76

My problem is that although I can get the %k parameter, %s{serial} returns me a NULL value. Looking at the hierarquical data udev gives me (read above) I noticed that I can get any data using %s{attribute} (i.e %s{size}, %s{range}, etc) as long as it is in the current device node (subsystem block):

Anything from above like %s{serial}, %s{product} or %s{authorized} returns me NULL, which is weird, since acording to the udev man (http://linux.die.net/man/7/udev), if %s isn't in the current node, it will search through the parents until the attribute is matched:

Quote:

$attr{file}, %s{file}
The value of a sysfs attribute found at the device, where all keys of the rule have matched. If the matching device does not have such an attribute, follow the chain of parent devices and use the value of the first attribute that matches. If the attribute is a symlink, the last element of the symlink target is returned as the value.

Also I read in an Ubuntu forum that at some point, they had a fixed bug in their version of udev that seems to be exactly my problem: