# Zaurus and Hotplug

## refriedbean

Hey guys  :Very Happy: 

I was just wondering how I would go about making hotplug detect my zaurus, and configure it correctly? 

I need the following to happen when I insert it;

modprobe usbdnet

ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up

route add -host 192.168.129.201 usb0

I've just converted from slackware, so if there is a better way to configure interfaces please tell me! 

Thanks!

----------

## PorkySpine

Hello! I was just about to put the answer to your problem in a new topic, just when i saw this topic...

This is my first post in this forum, and i am really happy to give my contribute to this comunity  :Very Happy: .

This is how i put my zaurus connecting with my gentoo machine, with HOTPLUG (witch is must better that configuring manually).

1- This tuturial is actually very good, and you can follow it until the hotplug part.

	http://www.ruault.com/Zaurus/ethernet-over-usb-howto.html

In my case, I had a little problem: my kernel crashes when i try to upload a file bigger than about  200Kb to my zaurus. I am sure that this will be solved soon with new versions of kernel and the patch.

If you have any problem with this, try to follow that tip in the tuturial:

In the /lib/modules/`uname -r`/modules.usbmap file one line needs to be changed. Look for a line that starts with the following:

 usbdnet              0x0193      0x40dd   0x8004    0x0000

 or

 usbdnet              0x0193      0x04dd   0x8004    0x0000

 and change one of them to this:

 usbdnet              0x0003      0x04dd   0x8004    0x0000

2- The hotplug part:

Hotplug is a little "manhoso" (as we would say here in Portugal, meaning "tricky"). Emerge it.

If you get this kernel message:

Jan 30 23:44:08 [/etc/hotplug/usb.agent] ... no modules for USB product 4dd/8004/0

you must put this in /etc/hotplug/usb.usermap:

usbdnet              0x0003      0x04dd   0x8004    0x0000       0x0000       0x02         0x00            0x00            0xff            0x010x00               0x00000000

It seems that hotplug can detect that your usb device can be a network device, and tries to bring it up, throug the script in /etc/hotplug/net.agent.

So, if you get this kernel log message:

Jan 31 00:20:14 [/etc/hotplug/net.agent] how do I bring interfaces up on this distro?

Jan 31 00:20:14 [/etc/hotplug/net.agent] register event not handled

all you have to do is make a copy of /etc/init.d/net.eth0 to /etc/init.d/net.usb0 (or make a link), and then put this in your /etc/conf.d/net:

iface_usb0="dhcp"

, since zaurus runs a dhcp server by default, and this way it will not show the "cannot connect" error message.

It will bring usb0 up and down automatic.

I hope that this was helpful.

----------

