Udev USB attribute rule not firing

Happy new year, everyone.
I’m stumped. I am trying to block one interface of a USB device blocked via a udev rule and it’s not picking it up for some reason. I tried every whichever way I found on the internet and it’s not working. It’s not firing even a RUN="echo hi" in the rule, so I think it’s not picking the rule up.
I know the /etc/udev/rules.d/99blah.rules gets picked up when I run udevadm test.
I can see a plug in event firing.
There’s one attribute I’m trying to specify that I didn’t see in search results, maybe that’s what I’m doing wrong somehow.
It’s a bInterfaceNumber="01" for a USB device (as seen via lsusb -v). So I do ATTRS{}==“” for idVendor and idProduct and then do ATTRS{"bInterfaceNumber"}=="01".
I am suspecting maybe I’m not filtering correctly? I’ve done this on Archlinux before a while ago but not remembering the details.

Why are there ATTRS and ATTR?? And SUBSYSTEMS vs SUBSYSTEM?

Run udevadm info --attribute-walk --path=whatever device such as /sys/bus/usb/devices/etc

This will show specifically all attributes and how to reference them. bInterfaceNumber show ATTR, not ATTRS for this specific attribute. And SUBSYSTEM, not SUBSYSTEMS.

This solves the problem, :heavy_check_mark:, the rule is triggered. You can always verify that the rule is triggered without reloading anything, unplugging anything, or rebooting by running: udevadm test "whatever device such as /sys/bus/usb/devices/etc"

1 Like