Recently I had to install a custom kernel for my Home server based on ARM kirkwood platform powered by Debian GNU/Linux. Here I have documented this for my future reference and also for your reference.
QNAP Home Server TS-110
Marvell Kirkwood platform based on ARM
Debian GNU/Linux 6.0 (Squeeze) based on 2.6.32 kernel
Step-1: Download the kernel source and dependencies for building
# apt-get install linux-source-2.6.32 build-essential lzma libncurses-dev
Step-2: Building the kernel
# cd /usr/src
# tar jxvf linux-source-2.6.32.tar.bz2
# cd linux-source-2.6.32/
Here you are free to apply your patches to kernel before proceeding with building.
# make oldconfig
The above command derives configuration running kernel to the new kernel build system.
# make menuconfig
In the above step, follow the General Setup -> () Local version – append to kernel release, and enter a version (alphanumeric) to differentiate your custom kernel from stock kernel. Ensure that this ends with your platform. In my case I have entered -blackgod-kirkwood. The platform name suffix is essential to ensure flashing of kernel.
Step-3: Installing the kernel
The next step installs the modules built in /lib/modules.
# make modules_install
In the next step, we are copying the kernel image to /boot directory.
# cat /usr/src/linux-source-2.6.32/arch/arm/boot/zImage > /boot/vmlinuz-2.6.32-blackgod-kirkwood
The step creates initial ram disk for this new kernel.
# update-initramfs -c -k 2.6.32-blackgod-kirkwood
Now you need to create symbolic links to your new kernel and initramfs in /boot. Here is mine.
# cd /boot
# ln -s initrd.img-2.6.32-blackgod-kirkwood initrd.img
# ln -s vmlinuz-2.6.32-blackgod-kirkwood vmlinuz
Now it is time to flash both kernel and initial ram disk in flash memory, so that your machine can boot with new kernel.
If your kernel version does not end with your platform (in my case it is kirkwood), you may end up with the following message.
Kernel /boot/vmlinuz-2.6.32-blackgod does not match your subarchitecture
kirkwood, therefore not writing it to flash.
Once booted you should have landed in new kernel.
Here is mine.
# uname -a
Linux debian 2.6.32-blackgod-kirkwood #1 Mon Apr 16 06:20:40 IST 2012 armv5tel GNU/Linux