In that question someone wanted a blacklist for all USB devices, and then only allow specific devices.
In this question, we want to accept all USB devices, but prevent the driver (e.g. cdc_acm) from taking one specific device type – for example, an LEGO® NXT brick in flash mode should not be taken (because fwflash needs raw access to the device), but an Arduino board should still be accessed by the driver to produce /dev/ttyACM0, in an educative environment accessing both NXT and Arduino hardware.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
I’ve been able to do this with an udev rule, after some trickery (and using lsusb to find out the vendor and product ID of the device in flash mode):
$ cat /etc/udev/rules.d/nxt.rules
# disable NXT in flash mode
ACTION=="add", ATTR{idVendor}=="03eb", ATTR{idProduct}=="6124", RUN="/bin/sh -c '/bin/echo -n $kernel:1.0 | /usr/bin/tee /sys/bus/usb/drivers/cdc_acm/unbind | /usr/bin/logger -t nxt-flashmode'"
This rule is triggered when an NXT brick is plugged in while in flash mode, or put into flash mode while plugged in. It does not prevent cdc_acm from grabbing it, but immediately after tells it to release the device, so fwflash can access it.
I have not found out what the :1.0 is, and why use that and not :1.1 which also shows up in sysfs. However, I wanted to share a working (for me) solution. Environment: Debian unstable as of end of October, 2014 (i.e. pretty much Debian jessie).
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0