How to Compile a Custom PdaXrom Kernel
for the Zaurus SL-C3100


I am using a Socket Low power WiFi CF that needed patches to the Orinoco drivers that is compiled in the default Beta 1.10 kernel for the SL-C3100. The Orinoco drivers work well for regualr wireless networking, but don't work with Kismet as they don't supoport the required monitor mode. In future releases this will probably be fixed, but you may need/want to customize your kernel for other reasons.

My solution was to compile the kernel without the Orinoco drivers compiled in as a module and then install seperately compiled updated drivers for the card. This solution was suggested by Chris Bryden Unfortunately his posted C1000 kernel didn't work on my C-3100.

Since my Linux laptop is running Ubuntu - Breezy and it uses gcc 4 instead of the required gcc 3.4; I wasn't able to cross compile the kernel on my laptop. Native compilation of the kernel on the Z is not possible. Instead I downloaded the vmplayer and the vm version of pdaXrom . This could also be done using the Live CD version as well. The advantage of using the vmware or Live CD is that the build environment is already setup which translates into fewer headaches.

I found the help given on Freenode #cacko channel to be very crucial, if not for his help I'd be looking for a new WiFi card. If you get stuck trying to compile, try looking for help there.

OK, what are the steps?

Install the vmplayer, extract the pdaXrom virtual machine files and load them into the player. You will also need to download the pdaXrom-builder tar ball, the kernel sources and the kernel cross compile tools. (Note the links are to what is current at the time of this writing - February 1, 2006. for future versions of pdaXrom these will need to be adjusted) If you have an internet connection within your vm or Live CD, this should be easy. I was behind a firewall and had to download the files on my host machine, copy them onto a USB drive, then plug the drive in while the vm was running and copy the files into the vm. The process I'm describing doesn't use the pdaXrom! builder directly, only the kernel patches and kernel config. There is a way to compile a custom kernel within the pdaXrom builder, but I couldn't get it to work (it tried to download files that it couldn't find) Hopefully, someone more knowledgable than I will create some documentation on that process.

Log in to the system (username=root, no password needed is needed)

If you want to work from the GUI: # startx and open a terminal (Aterm)

Make a directory to put your work
# mkdir /home/root/pdaXrom

Copy or download the above files, pdaXrom builder, kernel sources and kernel cross compile tools into the directory.

Go the root directory
# cd /

Extract the kernel cross compile tools:
# tar xjvf  ~/pdaXrom/arm-cacko-linux-gnu-2.95.3-2.15-2.2.5-hardfloat-10.48_20.12.05.tar.bz2

Return to working directory
# cd ~/pdaXrom

Extract the pdaXrom builder and kernel sources
# tar xvf ./pdaXrom-builder-18.24_22.01.06.tar.bz2
# tar xjvf ./linux-c3100-20050602-rom1_01.tar.bz2

Set the path so that the kernel cross tools are available
# export PATH=$PATH:/opt/cross/arm/2.95.3-2.15/bin

Change into the kernel source directory
#cd ./linux

Time to apply the patches. The patches are located in the pdaXrom-builder. The following commands are will work for the current version these will need to be modified for future versions or for different kernels for different models. You will find lots of different patches in the builder. I found that I only needed to apply the ones located in the generic directory. When I applied all of the patches in all of the other directories, it produced funky results. Unless you know that you need more than the generic patches, don't apply them.
# cat ../pdaXrom-builder/patches-local/linux-c3100-20050602-rom1_01/generic/linux-mmc.diff | patch -p1
# cat ../pdaXrom-builder/patches-local/linux-c3100-20050602-rom1_01/generic/linux-pdaXrom.diff | patch -p1

Now you need the to copy over the proper configuration for the kernel
# cp ../pdaXrom-builder/config/kernel/kernel-2.4.20-borzoi-cacko ./.config

Now when you fire up menuconfig it'll load the default options, and you can then make changes as needed
# make menuconfig

Once you made the needed changes, in this example: Network Device Support ->Wireless Lan Support (Non-Ham Radio) -> Hermes Chipset is deselected (no M or * in the bracket)

Exit and save configuration. Time to compile
# make dep && make zImage

Sit back and watch the matrix stream by or go up and get yourself a beer/soda/whatever.

When it finishes you should have a file in the ./arch/arm/boot/ directory called zImage, Woo Hoo, it worked!
Time to test it.

Take the tools.tar that sits on the CF or SD card you flash from and copy it so if you muck things up you can reflash.
# cp tools.tar tools.orig.tar

Extract the contents of tools.tar
# tar xvf tools.tar

Copy your brand-spanking new shiny kernel into the directory where it should go
# cp zImage ./tools/kernel-SL-C3100/zImage.bin

Get rid of the old tarball and create new one
# rm tools.tar
# tar cvf tools.tar tools

Now you're ready to reflash, congrats!

The last step for my solution to the Orinoco driver problem was to simply untar Chris' new compiled drivers
# cd /
#  tar xzvf /mnt/cf/orinoco-modules.tar.gz

To get Kismet to work I made the following script:
iwconfig eth0 mode monitor
aterm -e kismet
iwconfig eth0 mode managed

named it sniff, made it executable and copied to usr/bin
# chmod +x sniff
# cp sniff /usr/bin

That's it! As always, YMMV
Thanks to Sashz, Laze and all the folks who make up the Zaurus community, especial pgas ;)