Compiling USB to Serial Kernel Modules on the D2Plug

I recently ordered a GlobalScale D2Plug (makers of the SheevaPlug) and needed to be able to hook up a serial device via USB. The only problem was that the installed kernel did not have the proper modules available, namely pl2303 and ftdi_sio.

Although this unit was shipped running Ubuntu 10.04, performing software updates via aptitude did not work properly, the new kernel was not installed successfully and the kernel modules were not available. Rather than attempting to fix the package management problem, I have worked around the issue by building the modules manually.

Pre-Requisites
* root access
* Functional network/internet access
* development tools intalled
* curl installed (personal preferrence)
* no manual updating performed beyond specific tools required to perform tasks, (ie, freshly reflashed plug)
* using kernel 2.6.32.9-dove-5.4.2 (not the new 3/2012 kernel)
* DO NOT worry about the toolchain/cross compiler — that is for compiling D2Plug binaries on your desktop or other machine.

To get these modules compiled and installed, I had to download the kernel source and extract to /home/ubuntu/build/lsp (per the user guide) then compile and install the modules.

Step 1: Download the kernel source

$ mkdir -p /home/ubuntu/build/lsp/
$ cd !$
$ curl -C - -L -O 'http://www.plugcomputer.org/405/us/d2plug/kernel/d2plug_lsp_src_v0p4.tar.bz2'

Step 2: Extract the kernel source

$ tar xjvf d2plug_lsp_src_v0p4.tar.bz2
$ cd d2plug-linux-2.6.32.y

Step 3: Seed the .config to conform to values used to compile the stock D2Plug kernel

$ make dove_d2plug_defconfig

Step 4: Modify the .config to enable usbserial support and FTDI/PL2303, or apply the patch located here.

Step 5: Compile the kernel modules

$ make modules

Step 6: Install the kernel modules

$ sudo make modules_install

Step 7: Rebuild module dependency map file

$ sudo depmod

Step 8: Load kernel modules

$ sudo modprobe usbserial
$ sudo modprobe ftdi_sio
$ sudo modprobe pl2303

Once that process is complete, USB to Serial devices should work using either the FTDI or PL2303 drivers.

You can verify that the proper modules are loaded and in use by issuing the lsmod command (or cat /proc/modules):

ubuntu@D2Plug:~$ lsmod
Module                  Size  Used by
ftdi_sio               29308  0 
pl2303                 13771  0 
usbserial              24840  2 ftdi_sio,pl2303
hdmitx                119185  0 
binfmt_misc             5897  1 
bmm_drv                 5379  0 
sg                     15417  0 
galcore                64024  0 
ubuntu@D2Plug:~$ 

Note that the usbserial module is loaded and is used by 2 modules, the pl2303 and ftdi_sio modules.

Have a question or comment about this post or topic? Send me an email; linux (AT) itsecureadmin (DOT) com.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *