Difference between revisions of "Rpi kernel compilation"

From eLinux.org
Jump to: navigation, search
(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...")
 
(Transferred to RPi Kernel Compilation, intentionally blanking and redirecting)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= Raspberry PI kernel compilation =
+
#REDIRECT [[RPi 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.
+

Latest revision as of 20:28, 28 January 2012