[ale] udev rules for USB

Erik Mathis erik at mathists.com
Thu Nov 28 09:40:36 EST 2013


Will '/usr/bin/perl /lib/libexec/usb-load' even work?

-Erik-
On Nov 21, 2013 5:41 PM, "Chris Fowler" <cfowler at outpostsentinel.com> wrote:

>  I'm writing a udev rule that I want to run only when something is plugged
> into a USB port
>
>
>
>
>
>
>
>
>
>
>
> *ACTION!="add", GOTO="end01" BUS=="usb",RUN+="/lib/libexec/usb-load %b
> %s{idVendor} %s{idProduct}", $attr{idVendor}, $s{idProduct}
> SUBSYSTEM!="net", BUS!="usb", GOTO="end01" SYSFS{idProduct}=="9700",
> SYSFS{idVendor}=="0fe6", KERNEL=="*", RUN+="/sbin/modprobe dm9601"
> LABEL="end01" *
>
> My goal is to load the necessary modules on this system.  The problem is
> that the perl script 'usb-load' is not executed.   I can easily remove the
> BUS=="usb" part and have it run on all devices and it can look at devpath
> to see USB.  The problem is that this would be cpu intensive.   I want it
> to execute whenever a usb-serial, usb-modem, or usb-storage device is
> attached.   In some cases the kernel does not know that a certain vId and
> pId is attached to a driver and I have to load it myself.  You see that
> example where I am having to load the dm9601 driver for a usb-net device.
> I see the same for usb-storage.  Some USB sticks the kernel loads
> usb-storage for some it does not know to. If I capture the vId and pId I
> can then look it up and load up the correct one.
>
> Chris
>
>
>
>
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20131128/4f30a8e6/attachment.html>


More information about the Ale mailing list