Rpi kernel compilation

From eLinux.org
Revision as of 09:31, 22 January 2012 by Rew (Talk | contribs) (Created page with "= 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...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.


compiling

Next you have to configure the kernel.

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

This will ask the least amount of questions. I selected processor "6" (the first (only?) broadcom processor I saw). Someone at rapsberrypi foundation should publish a proper config.

Then building the kernel:

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

At the moment (Jan 22nd, 2012) there is an undeclared function and some undeclared variables in arch/arm/mach-bcmring/dma.c , and a whole bunch of mach/gpio.h not found errors.

You can add "-j 3" to improve compilation speed if you have enough RAM and 2 cores. Use "-j 5" if you have 4 cores. (I recommend one more than the number of cores, to allow a bit of overlapping CPU operations with IO)


on the Raspberry pi itself

Get the sources just like above.

TODO: write the rest of this section.