[Eee Pad Transformer Q&A, Help & Troubleshooting] rdnetto:
Custom Kernel Guide

This is a quick guide I've written for anyone who wants to use a different kernel, since the original one is now rather outdated and doesn't support the mouse.

This guide is designed to be run entirely on the transformer, and assumes a working knowledge of how to use the Linux terminal. Note that compiling the kernel on the transformer is rather slow (it takes ~15 min), and is significantly faster (albeit more complicated) on a decent desktop.

It also assumes a working internet connection. I suggest you get networking first, otherwise you'll need to manually download the files instead of using git clone.

DISCLAIMER: I am not responsible if anything goes wrong.

Preparation

Make sure that you know how to enter recovery mode and install a zip file with CWM. You'll need a CWM zip file containing a known good kernel for Ubuntu - I've attached the original one as CWM.zip. I suggest keeping it on a microSD card to be safe.

We'll start by installing some packages needed to compile the kernel.

sudo apt-get install build-essential libncurses5-dev libblkid-dev libblkid1

There are also a few tools we need to compile from source and install.

cd /tmp
git clone git://gitorious.org/ac100/abootimg.git
cd abootimg
make -j2
sudo cp abootimg /usr/bin/
cd ..

git clone http://github.com/AndroidRoot/BlobTools.git
cd BlobTools
make -j2
sudo cp blobpack blobunpack /usr/bin/
cd ~

Next we download the source code for lilstevie's repository. Since this is updated from time to time, you may wish to subscribe to the RSS feed so you know when new features are released.

You can download it either with

git clone git://github.com/lilstevie/linux_kernel_TF101

or by downloading the source directly from the website and extracting it with 'unzip source.zip' or 'tar axf source.tar.gz', depending on the extension.

'git clone' appears to freeze when resolving deltas, but it is actually doing something and does finish eventually.

Compilation

export ARCH=arm
make tf101_gnulinux_defconfig

This should be run in the folder containing the kernel source code (there'll be lots of files including one called Makefile). This loads the default options for the kernel.

make menuconfig

These are configuration options for the kernel. Set General Setup -> Cross-compiler tool prefix to a blank string (we don't need this because we're compiling on an ARM system, not a x86 desktop).

I also suggest ticking General Setup -> Automatically append version info to the version string (it's just under the cross compiler option) to avoid problems loading modules compiled with a different setup. If you don't, make sure you run 'sudo rm -rf /lib/modules/2.6.36.4*' immediately before 'make modules_install'.

The most useful options here are under File Systems - these add support for different file systems. e.g. ISO, CIFS, etc. When enabling these set them to be compiled as modules (designated by a M instead of a *) wherever possible, as there is a limit on the maximum size of the kernel.

Leave everything else alone, unless you understand what they do.

If you make any changes here after compiling the kernel, run 'make clean' before compiling it again.

make -j2

This compiles the kernel. The 2 tells the compiler to use 2 threads, since the transformer has 2 cores. If you get any error messages, then you either skipped a step or enabled something you shouldn't have.

Flashing the new kernel

While still in the kernel directory, run:

sudo make modules_install
sudo depmod -a

to install the kernel modules. Note that you must have run the wifi driver injection script at some point in the past for those modules to work, as they depend on some closed source binaries.

If you're just testing to see if the kernel works you can skip this step, but you won't have wifi access.

mkdir ~/flasher
cp arch/arm/boot/zImage ~/flasher/
cd ~/flasher

Here we create a new directory and copy our compiled kernel into it.

Extract the contents of flashkit.zip into this folder. Here's a quick explanation of where the files in it come from:

bootimg.cfg - from the default kernel image, contains kernel arguments

initrd.img - from the default kernel image

kernelblob.HEADER - from the blob in the CWM zip

flash.sh - I wrote this

./flash.sh

Run the script. This will package the kernel into a blob, write it to mmcblk0p4, then reboot the netbook.

You should see the blue bar filling up as it flashes the new kernel. If you boot successfully, run lsmod to verify that the modules were loaded (e.g. bcm4329). Note that only modules listed in /etc/modules will load to boot time.

What to do if you get stuck in a reboot loop or have kernel panics:

Reboot, and hold down VOL_DOWN, then VOL_UP to get into CWM and install that zip file I mentioned earlier.

What to do if it freezes at the eeePad logo

It may be neccessary to flash the blob by creating a CWM zip and using the Install a Zip File option instead of running dd, which the script does. If you have this problem, delete or comment out the lines in the script beginning with 'sudo' and use that method. I have no idea why this makes a difference, but apparently it does for some people.

Notes

If you want to compile the kernel on a desktop, you need to install gcc-arm-linux-gnueabi as well and manually copy the modules across. You may also want to use tmpfs to speed it up even further if you 1+ GB of unused RAM.

If your system becomes very unstable and prone to crashing, you're probably trying to use the wrong modules with wrong kernel. Delete the modules with 'sudo rm -rf /lib/modules/$(uname -r)', run make clean and compile your kernel again.

This method will not work with the experimental uboot bootloader lilstevie is working on.

The current release of the kernel causes the network manager to detect wlan0, but the inability to scan means you still need to connect from the terminal. This will only work if you disable the network manager with 'sudo /etc/init.d/network-manager stop'.

You can verify your initrd is not corrupted with 'gzip -t initrd.img'

If you want to create a new CWM zip file containing your new kernel, all you need to do is copy the existing one and overwrite the kernelblob file in it with the blob file created by flash.sh.

Features supported by kernel (at time of writing)

Touchpad works, but isn't detected as one so it won't be automatically disabled when you're typing. Multitouch works (e.g. 2 finger tap to right click), but not gestures (e.g. scrolling).

Wifi supports scanning with 'sudo iwlist wlan0 scan; sudo iwlist wlan0 scan last' (this is compatible with Gnome but not KDE)

Battery meter works, but only from the terminal (see here)

Audio works, but only for headphones (not external speakers). FLAC playback is choppy.

Hardware acceleration doesn't work