If you have followed my previous post on how to install Debian to the Iomega iConnect Wireless Data Station you have been dying to read this follow-up post on how to take you iConnect to the next level by customizing the kernel and finally controlling the buttons and leds in the device (not to mention making use of the wireless card).
Setting up a cross-compile environment
First thing you need is to setup an environment in which you will cross compile the kernel and everything else that needs to go into the iConnect. Don’t take me wrong here, the iConnect is a great device and all, but it just can’t compete with your state of the art laptop/workstation ;)
In my case I’ve setup a virtual machine with Ubuntu 10.10 32bits, but any Linux distribution will work as long as it is 32bits
Second step, was to setup a cross-compiler. The requirement on using a 32bits Linux is related to the cross-compiler I’ve chosen, which was the Sourcery G++ Lite 2010q1-188 for ARM EABI. You can find it here.
Next I setup everything in /usr/src. But you can use any other place in your environment, as long as you adapt the PATH’s. My /usr/src looks like this:
In the linux dir you will find the vanilla kernel source code as downloaded from kernel.org
Kernel Compile
Configuring and compiling the kernel is much like a “normal” one, except for some extra parameters:
You will find the kernel (uImage) in /usr/src/linux/arch/arm/boot/uImage and modules in /usr/src/lib. Copy everything into your iConnect (placing uImage in the /boot dir and modules in /lib). Change the uboot parameters to point to your new uImage and you are set!
You might be wondering which parameters to use in your kernel config. You can find my kernel config here for 2.6.36 with the patches provided by Iomega (read below).
Patching the kernel
Now that we know how to compile a kernel, lets figure how to control iConnect leds and buttons.
If you payed any attention to my /usr/src/ listing you have probably noticed the file EMCLifelineOEMSW-2.2-GPL.zip. This file is part of Iomega iConnect Open Source Code which can be found in your drivers CD or downloaded from here (although I’m not sure which version you will get).
There are several files inside this package, but the only one of immediate interest to us is kernel dir which contains a kernel config file, the original linux kernel tar.gz and a series of patches which you need to apply to the vanilla kernel source (refer to other websites on how to apply patches to a kernel tree)
Controlling your leds/buttons
This is way to easy :). Just go to /sys/class/leds and you will find sysfs control files to all your leds. Just play with them! example:
Has for the button, you can find it in /sys/class/input/event0/device.
I haven’t done anything yet with the leds or button, but if I do, I will post about it here in the blog.
Questions ? Drop a comment below.