Gentoo (USB)

From OESF

Jump to: navigation, search

This howto has been contributed by Gerald J. Normandin Jr.

This howto was taken from http://www.gentoo.org/doc/en/gentoo-pda.xml, and is covered under the Creative Commons - Attribution / Share Alike license.


The Zaurus has the handy feature of being able to connect to your computer like a device on the network, but it does not require a network card (NIC). All that you need is your Zaurus' USB cradle, and the usbd kernel module.

The first thing that has to be done is the kernel patch. The usbd driver is a patch file that is patched against a kernel tree, and then enabled during kernel configuration.

Getting and Installing the usbd kernel patch

 cd /usr/src
 wget http://www.oesf.org/howto/downloads/usbdnet-2.4.18-patch.gz

Patch for kernel 2.4.18

 wget http://www.oesf.org/howto/downloads/usbdnet-2.4.19-patch.gz

Patch for kernel 2.4.19

 wget http://www.oesf.org/howto/downloads/usbdnet-2.4.20-patch.gz

Patch for kernel 2.4.20

Now, patch the kernel, where 2.4.x is the patch that corresponds to your kernel version

 zcat usbdnet-2.4.x.patch.gz | patch -p0

Once that is done, configure your kernel and add these options:

Kernel Configuration

While in /usr/src/linux

 make menuconfig

In "Code maturity level options", select "Prompt for development and/or incomplete code/drivers" In "USB support", section "USB Network adaptors", select (as a module) "USBD Network (Encapsulated) Host-to-Host Link (EXPERIMENTAL)" Then enter 04dd in USBD Network idVendor and 8004 in USBD Network idProduct.

It does not matter if the usbd module is built as a module or into the kernel. If you do build it as a module, make sure that you load it after you reboot. Additionally, make sure that you have the necessary USB information built into your kernel, as noted above.

After your kernel is configured and you have rebooted, it is time to see if the patch has worked and you are in business.

After turning your Zaurus on, insert it into the cradle and hit the sync button. If you check /var/log/messages, you should see some information like this:

/var/log/messages output

 tail -f /var/log/messages

output hub.c: USB new device connect on bus1/1, assigned device number 38 usb.c: USB device 38 (vend/prod 0x4dd/0x8004) is not claimed by any active driver. v0.4b sl@lineo.com, tbr@lineo.com usbdnet.c: v0.4b sl@lineo.com, tbr@lineo.com usbdnet.c: USB Host to Device Network - for Linux USB Devices using MDLM/CDC usb.c: registered new driver usbdnet

If all goes well with that step, move on to loading the network device:

Loading the USB network device

 ifconfig -a

One of the adapters, namely usb0 should show up in the list.

Now it is time to setup the network on the Zaurus. USB Networking is similar to PPP in that each device on either end gets an IP address. The IP address on the Zaurus is set via the network setup tool. If it is not "192.168.129.201" then use the given IP adddress when trying to ping the Zaurus below.

If when you put the Zaurus in the cradle an interface other then usb0 is created, replace all usb0 instances with that interface name for this section of the HOWTO. You should be able to configure the device using the following commands:

Configuring the Zaurus

This is entered into your desktop's command line

 ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
 route add -host 192.168.129.201 usb0

Now, try to ping the Zaurus, ping 192.168.129.201, if you've got a reply then you are sucessfully connected!

Note: The above steps will only get your desktop talking to the Zaurus for syncing purposes. If you wish to connect to the Internet from the Zaurus via the USB cradle, please consult the Sharp Zaurus Developer website.

Miscellaneous Procedures

Before compiling any programs that you will be using for your PDA, it is a good idea to add the pda USE variable to /etc/make.conf. Doing this will ensure that any programs you have will have their optional PDA (if availible) support built-in.

Editing /etc/make.conf

 vim /etc/make.conf

You are looking for this line USE="use1 use2 etc pda"

Personal tools