Building a Custom Debian Kernel for the BeagleBoard

Tags: , , , ,

While trying to get my WIFI dongle to work with the BeagleBoard, I noticed that the dongle’s module was not compiled into the kernel. So I had to build a new kernel from scratch. Since building a new kernel under the BeagleBoard will take a LOT of time, I decided to cross-compile a kernel for the ARM architecture under my AMD-64 arch PC.

The following steps describes building a custom Debian kernel for the BeagleBoard using cross-compiling:

Installing required dependencies

Install proper build environment:

apt-get install git-core kernel-package fakeroot build-essential \
curl libncurses-dev uboot-mkimage

Edit /etc/apt/sources.list and add the Embedded Debian Project sources:

#debian embedded
deb http://www.emdebian.org/debian/ unstable main

Now execute:

apt-get update
apt-get install cpp-4.3-arm-linux-gnu  g++-4.3-arm-linux-gnu gcc-4.3-arm-linux-gnu

You now have a build environment capable of compiling a kernel for the ARM platform. Next step is to acquire and compile the kernel

Acquiring and Compiling the Kernel

Retrieve the GIT checkout:

git clone git://git2.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
cd linux-omap-2.6/
git checkout 58cf2f1 -b v2.6.29-58cf2f1
git archive --format=tar --prefix=v2.6.29-58cf2f1/ v2.6.29-58cf2f1 | gzip > ../v2.6.29-58cf2f1.tar.gz
git checkout master
git branch v2.6.29-58cf2f1 -D
cd ..

Download kernel diffs and kernel config:

wget http://rcn-ee.homeip.net:81/dl/omap/beagle/v2.6.29-58cf2f1-oer34/v2.6.29-58cf2f1-oer34.diff
wget http://rcn-ee.homeip.net:81/dl/omap/beagle/v2.6.29-58cf2f1-oer34/defconfig

Extract Kernel Source

tar -xf v2.6.29-58cf2f1.tar.gz
cd v2.6.29-58cf2f1/

Apply Patch

patch -p1 < ../v2.6.29-58cf2f1-oer34.diff

Copy Defconfig

cp ../defconfig .config

Configure the kernel (requires libncurses5-dev installed)

make menuconfig

Build, Cross-Compiling:

make CROSS_COMPILE=arm-linux-gnu- uImage

A few moments later, you can find your new kernel in the ‘arch/arm/boot/’ directory.

Make modules:

make CROSS_COMPILE=arm-linux-gnu- modules

make CROSS_COMPILE=arm-linux-gnu- modules_install

make CROSS_COMPILE=arm-linux-gnu- modules_install INSTALL_MOD_PATH=arch/arm/boot”

Congratulations, a new kernel is compiled! Now move uImage and the arch/arm/boot directory to the sdcard.

Next step is to boot and test my WIFI dongle again.

You can find some more information about building a Debian kernel here.

Subscribe now via RSS and never miss a post!

1 Response to "Building a Custom Debian Kernel for the BeagleBoard"