Tuesday, June 29, 2010

USB Serial Adapter Drivers for Chromium

A few weeks ago I downloaded Chromium OS Flow and tried it out on my netbook using a jump drive. I really liked it a lot, although the USB device was slow and had a tendency to stall out. So I pulled out an 8GB SDHC SD card that I had been hoarding and installed Chromium Flow to that. And all I can say is *WOW*. This OS is awesome. It boots (and shuts down) on a dime. The interface is quite slick. And it has a full screen terminal with apt-get and a lot of installable software.

But then I ran into a problem. Lately I have been resetting a lot of router passwords using a console cable (don't ask). To perform this technique, you need a serial port. No laptop or netbook made in the past ten years has a serial port on it so I usually get by with a USB to serial adapter (aka "a serial dongle"). We happen to have one at work, which was lucky. Except it didn't work at all in Chromium.

Long story short ...
1) I had to use gparted on a jump drive to resize some partitions. Chromium Flow is a 2GB "image". So I needed to move some boundaries to take advantage of all that empty space on my SD card.
2) I had to relocate /var/cache/apt. The tiny slice that the directory sits on didn't leave much room for installing software. I moved the directory to /, and then created a symbolic link to it.
3) I installed the build-essential and kernel source (2.6.31) packages.
4) I unzipped the kernel source, turned on all of the USB serial drivers as modules, and then built a kernel.
5) Now I have a little stack of kernel modules for a slew of USB to serial adapters.

I can load it with insmod ./pl2303.ko. If I do a dmesg | tail I can see that it loaded properly. Now when I plug in my dongle, it gets a serial device assignment whereas before all I got was a notice telling me that it was plugged in.

If you are in need of a USB serial adapter driver for Chromium flow, just use mine. This should save you a couple of hours. ;-) You can download the bundle of kernel modules here: http://www.oddree.com/rayhaque/usbserial.tgz

Tomorrow I can fire up minicom and start rocking out Cisco console ports with my little netbook and not have to drag around a 25 pound P.O.S. with Windows XP and Hyperterminal! Hooray!

** EDIT ***
I guess I should tell anyone who might download this how you should use it.
1) Get the file downloaded. From terminal ...
wget http://www.oddree.com/rayhaque/usbserial.tgz
2) Untar/zgip it...
tar -xzvf usbserial.tgz
3) Move the directory into the right place alongside your other kernel modules ...
mv usbserial /lib/modules/2.6.31-4-intel-menlow/kernel/drivers/usb
4) Change to that directory and optionally rename it to what it would normally be...
cd /lib/modules/2.6.31-4-intel-menlow/kernel/drivers/usb/usbserial && move usbserial serial
5) Make the kernel aware that there are new modules out there ...
depmod -a
6) Now, load your module. If you were using the same one as me ...
modprobe pl2303
7) Check the dmesg output for clues as to whether or not the driver is working ...

ENJOY! :-)