Ubuntu kernel build alternatives

From OMAPpedia

Revision as of 13:01, 18 November 2010 by Sebastien Jan (Talk | contribs)
Jump to: navigation, search

This page gathers several options for building an Ubuntu kernel, either as a binary package or directly using the standard kernel make command, both natively (on an ARM board) or cross-compiled.

Several ways for generating an Ubuntu kernel are described here. Prefered way is described here Ubuntu kernel for OMAP4:


A note on required tools / packages

If you need to generate kernel packages, you will have to install additional tools. Most of the tools can be installed by running:

sudo apt-get build-dep linux-image-$(uname -r)

Here is a non-exhaustive list of the packages that are usually required for packaging: git-core debhelper build-essential fakeroot kernel-wedge libelf-dev debhelper xmlto docbook-utils gs transfig sharutils pbuilder binutils-dev libdw-dev asciidoc

Native compilation


debuild is a wrapper on top of dpkg-buildpackage. It is installed with the devscript package: sudo apt-get install devscript

debuild -b -uc -us


fakeroot debian/rules clean
dpkg-buildpackage -B


fakeroot debian/rules clean
export $(dpkg-architecture -aarmel)
do_tools=false fakeroot debian/rules binary-arch

kernel Makefile

cp debian.ti-omap4/config/config.common.ubuntu .config
make uImage 


Here, you will need a cross toolchain. The cross-toolchains usually used are:

Linaro toolchain is prefered as more up to date, and in line with the gcc shipping with Ubuntu.

The examples below assume you are using the CodeSourcery 2010q1 toolchain. If you want to use Linaro instead, just replace arm-none-linux-gnueabi- by arm-linux-gnueabi-.


debuild -eCROSS_COMPILE=arm-none-linux-gnueabi- --prepend-path=<path to your codegen .../bin/> -edo_tools=false -aarmel -uc -us -b

(replace <path to your codegen .../bin/> with the correct path)


fakeroot debian/rules clean
CROSS_COMPILE=arm-none-linux-gnueabi- do_tools=false dpkg-buildpackage -B -aarmel -uc -us


fakeroot debian/rules clean
export $(dpkg-architecture -aarmel)
CROSS_COMPILE=arm-none-linux-gnueabi- do_tools=false fakeroot debian/rules binary-arch

(note: the do_tools=false is required with CodeSourcery 2010q1 - to be checked with Linaro or more recent CodeSourcery)

kernel Makefile

cp debian.ti-omap4/config/config.common.ubuntu .config
CROSS_COMPILE=arm-none-linux-gnueabi- make
CROSS_COMPILE=arm-none-linux-gnueabi- make uImage 

kernel source package

The kernel source package contains the kernel sources. Here is an easy way to generate it:

git clean -fdx
fakeroot debian/rules clean
time debuild -S -sa -uc -us -I.git -I.gitignore -i'\.git.*' 


Personal tools