Over year ago I wrote How to cross compile ARM kernel under Ubuntu 10.10 and this became one of most popular posts on my website. It may work still but it is terribly outdated so I decided that it is a time for update.
Users of Ubuntu 12.04 ‘precise’ have much simpler situation when it comes to cross compilation of Linux kernels than ones who use older releases. Everything is now in distribution, we have a lot of packages converted to multiarch so instruction is much shorter.
There are few steps to cross compile Linux kernel under Ubuntu 12.04 ‘precise’ (for “armhf” which is officially supported now):
- Install cross compiler:
apt-get install gcc-arm-linux-gnueabihf
- Fetch kernel source:
apt-get source linux-source-3.2.0
- Install packages required to build kernel:
apt-get build-dep linux-source-3.2.0
- Build kernel:
cd linux-3.2.0; dpkg-buildpackage -b -aarmhf
And that’s all. Linaro kernels will be as easy to build as Ubuntu one on next days as we have to update packaging to recent Ubuntu version.