Generate a New udev Rule

Get Info on a Device

udevadm info --name=${dev_node} --attribute-walk

Produce Rule

ACTION=="add", ENV{ID_VENDOR_ID}=="2c7c", ENV{ID_MODEL_ID}=="0125", ATTRS{bInterfaceNumber}=="03", SYMLINK+="ec25-at"

Tip

The match keys are KERNEL, SUBSYSTEM, DRIVER and ATTR... To match a parent's property too, use the plural, e.g: ATTRS.

Warning

When matching against parent properties (e.g: using ATTRS), all parent matches must be valid for a single parent.

Multiple Parents

It sounds like it should be possible to use multiple parents, like this... but I couldn't get it to work.

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{ec25}="yes"
ACTION=="add", ENV{ec25}=="yes", ATTRS{bInterfaceNumber}=="03", SYMLINK+="ec25-at"

Reload Rules

udevadm control --reload-rules

Test Rule

dev_path="$( udevadm info -q path -n ${dev_node} )"
action="add"
udevadm test -a "${action}" "${dev_path}"

Tip

udevadm test gives you a list of the environment variables that are available!

Reference