If you want to check order of actions use:
udevadm monitor --property
by doing this you get a listing of actions. When you add your camera one of the first entries is likely to be something like:
KERNEL[110935.814197] add /devices/.../video4linux/video1 (video4linux)
DEVNAME=/dev/video1 <<<<---- devname
As pointed out by @goldilocks:
Unfortunately, if you are using systemd, it's version of udev has a complex "persistent naming scheme" that's hard coded into udevd, so you are right, just parsing the
rules.d stuff could leave a lot of mysteries.
man udev for systemd:
The following keys can get values assigned:
The name to use for a network interface. See systemd.link(5) for a higher-level mechanism for setting the interface name. The name of a device node cannot be changed by udev, only additional symlinks can be created.
Naming and debugging
Your best option is likely to use something like:
udevadm test $(udevadm info -q path -n video1)
It gives you a "test run" on your rule(s) and report any errors.
After adding/changing a rule, remember to reload with:
udevadm control --reload-rules
When it comes to naming a devices you likely get something like:
NAME="smile2thecamera" ignored, kernel device nodes can not be renamed;
please fix it in /etc/udev/rules.d/83-webcam.rules:6
You could instead use a SYMLINK (if that suffice) as in:
KERNEL=="video[0-9]", .... SYMLINK+="video-logitech"
Should give you something like this on test:
creating link '/dev/video-logitech' to '/dev/video1'
creating symlink '/dev/video-logitech' to 'video1'