Ubuntu kernel build alternatives

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
m
 
(3 intermediate revisions not shown)
Line 40: Line 40:
= Cross-compilation =
= Cross-compilation =
Here, you will need a cross toolchain. The cross-toolchains usually used are:
Here, you will need a cross toolchain. The cross-toolchains usually used are:
-
* Linaro one: https://wiki.linaro.org/WorkingGroups/ToolChain/CrossCompilerOnLucid
+
* Linaro one: https://wiki.linaro.org/MarcinJuszkiewicz/Projects/UbuntuCrossToolchains (https://wiki.linaro.org/WorkingGroups/ToolChain/CrossCompilerOnLucid)
* CodeSourcery one (2010q1 link): http://www.codesourcery.com/sgpp/lite/arm/portal/release1293
* CodeSourcery one (2010q1 link): http://www.codesourcery.com/sgpp/lite/arm/portal/release1293
Linaro toolchain is prefered as more up to date, and in line with the gcc shipping with Ubuntu.
Linaro toolchain is prefered as more up to date, and in line with the gcc shipping with Ubuntu.
Line 67: Line 67:
  cp debian.ti-omap4/config/config.common.ubuntu .config
  cp debian.ti-omap4/config/config.common.ubuntu .config
-
  CROSS_COMPILE=arm-none-linux-gnueabi- make
+
  ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make
-
  CROSS_COMPILE=arm-none-linux-gnueabi- make uImage  
+
  ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make uImage
= ABI and modules change verification =
= ABI and modules change verification =
The kernel packaging tools will fail package creation if the kernel ABI or modules-list changed since the last packaged version. This test can be skipped to complete the package creation in spite of ABI or modules list change. Add the following option depending on your build method:
The kernel packaging tools will fail package creation if the kernel ABI or modules-list changed since the last packaged version. This test can be skipped to complete the package creation in spite of ABI or modules list change. Add the following option depending on your build method:
-
* debuild: add '-eskipabi=true -eskipmodules=true' to your command line
+
* debuild: add '-eskipabi=true -eskipmodule=true' to your command line
-
* dpkg-buildpackage and debian/rules: add 'skipabi=true skipmodules=true' to your command line
+
* dpkg-buildpackage and debian/rules: add 'skipabi=true skipmodule=true' to your command line
= kernel source package =
= kernel source package =
Line 84: Line 84:
= Links =
= Links =
 +
 +
[[Category:Ubuntu]]

Latest revision as of 14:26, 27 September 2011

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:

Contents

[edit] 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

[edit] Native compilation

[edit] debuild

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

[edit] dpkg-buildpackage

fakeroot debian/rules clean
dpkg-buildpackage -B

[edit] debian/rules

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

[edit] kernel Makefile

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

[edit] Cross-compilation

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-.

Note: the do_tools=false option is required with CodeSourcery 2010q1. It will prevent the generation of the tools binary package (including perf) that would fail with CodeSourcery 2010q1 toolchain (to be checked with Linaro or more recent CodeSourcery).

[edit] debuild

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)

[edit] dpkg-buildpackage

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

[edit] debian/rules

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

[edit] kernel Makefile

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

[edit] ABI and modules change verification

The kernel packaging tools will fail package creation if the kernel ABI or modules-list changed since the last packaged version. This test can be skipped to complete the package creation in spite of ABI or modules list change. Add the following option depending on your build method:

[edit] 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.*' 


[edit] Links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox