Rpi kernel compilation

From eLinux.org
Revision as of 06:31, 22 January 2012 by Abusse (Talk | contribs) (compiling)

Jump to: navigation, search

Raspberry PI kernel compilation

You can compile the kernel on the board itself, but you can also cross compile on a standard Linux machine (or maybe even on Windows machines?) .

The following documents my attempts at compiling the raspberry pi kernel.

cross compiling

getting the compiler

On Ubuntu Oneiric getting the arm cross compiler can be as easy as:

sudo apt-get install gcc-4.6-arm-linux-gnueabi

(TODO: Is this the right one? More packages required? I did this a while ago! TODO: Other distributions?)

getting the sources

using git

create a directory where you can work on the raspberry pi software. I called mine "raspberrypi". Then clone the git repository.

mkdir raspberrypi
cd raspberrypi 
git clone https://github.com/raspberrypi/linux.git
cd linux

using the patch

TODO: write this.


Next you have to configure the kernel:

cp arch/arm/configs/bcmrpi_cutdown_defconfig .config
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- oldconfig

Then building the kernel:

make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -k

You can use the "-j" flag to improve compilation time. If you have a dual core machine you can use "-j 3", for a quad core machine you can use "-j 6", and so on.

on the Raspberry pi itself

Get the sources just like above.

TODO: write the rest of this section.