View Single Post
Posts: 631 | Thanked: 837 times | Joined on May 2007 @ Milton, Ontario, Canada
#54
Okay that's a step in the right direction.

If you want to make the usbEthUp launch automatically for your targus/any other device, you just need to add an entry to the Udev rules. You can usually find the vendor and product ID values listed in your dmesg output, then it's simply a matter of adding a new rule to /etc/udev/rules.d/z98_usbEth.rules.

For example, the two entries right now read:

#UDEV rules to bring up and shutdown Eth0 interface when USB network adapter is connected/removed
SUBSYSTEMS=="usb", ATTRS{idProduct}=="8150", ACTION=="add", RUN+="/usr/sbin/usbEthUp.sh"

SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/sbin/usbEthDown.sh"


As you can see, it runs usbEthUp.sh anytime a usb device with a product ID of 8150 is attached. If you check your dmesg look for a section that talks about device and product (i.e. with my USB100M it says "device v0bda p8150 is not supported") like this:


usb 1-1: new full speed USB device using musb_hdrc and address 9
[13538.375000] usb 1-1: ep0 maxpacket = 8
[13538.375000] usb 1-1: default language 0x0409
[13538.390625] usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=3
[13538.390625] usb 1-1: Product: Linksys USB LAN Adapter
[13538.390625] usb 1-1: Manufacturer: Linksys
[13538.390625] usb 1-1: SerialNumber: 2603
[13538.390625] usb 1-1: device v0bda p8150 is not supported
[13538.390625] usb 1-1: uevent
[13538.390625] usb 1-1: usb_probe_device

The "p8150" is what you're after; p means productID, and 8150 is the 4 digit string. Your targus should have a similiar line in the output, but it'll have different device v (vendor) and p (productID) values. Take the 4 digit number after the p, and add it to your udev rules entry. So if the number was say 5555, then you would simply add this to the end of the existing z98_usbEth.rules:


SUBSYSTEMS=="usb", ATTRS{idProduct}=="5555", ACTION=="add", RUN+="/usr/sbin/usbEthUp.sh"

Then next time you connect the targus it will automatically launch the usbEthUp script for you as root.

Thanks,
-Rob
 

The Following User Says Thank You to jolouis For This Useful Post: