Hardware Reference
In-Depth Information
needed for the Linux kernel to work on the Raspberry Pi is yet merged into the official
Linux kernel source tree.
The first step to building your own kernel is to decide whether you want to do so
natively from within the Linux instance running on the Raspberry Pi or to build it on
an x86 Linux system with a properly configured cross-compiler toolchain. We strongly
recommend the latter approach, because it will go much much faster (several hours
faster) and it is not that much more complicated.
We'll assume that you're building your new kernel with a cross-compiler toolchain—
specifically, the one described in Hack #21 . You will also need to have the make and
ncurses-dev (or ncurses-devel ) packages installed on your x86 Linux system.
If you really prefer to build the kernel natively on the Raspberry Pi, make sure that
you have the gcc , make , and libncurses-dev (or ncurses-devel ) packages in-
stalled. Then, simply omit the ARCH=arm CROSS_COMPILE=arm-rpi-linux-
gnueabi- flags from each command-line invocation. You will also need to have a
copy of the Raspberry Pi Linux kernel source tree present in the running Linux
filesystem.
Download the Kernel Source Tree
First you'll need to download a copy of the Raspberry Pi Linux kernel source tree. There
are currently several branches under development:
rpi-3.2.27
This was the original kernel source that the first Raspberry Pi Linux distributions
were using, but it is rather out of date at this point.
rpi-3.6.y
This is the active development kernel source tree, based on the kernel indicated
(3.6.11 as of this writing).
rpi-3.8.y , rpi-3.9.y , rpi-3.10.y , and rpi-3.11.y
These branches were created to track the various newer kernels. If you need
something specific with a newer branch, these might help you out.
The instructions in this hack will work for any kernel branch, but we strongly recom-
mend that you start with the rpi-3.6.y source tree, because it is still getting new
functionality and has the added advantage of several additional upstream releases'
worth of bug fixes and features.
Either way, you need to check out the Raspberry Pi Linux kernel source tree from Git.
We recommend you put this checkout in your ~/raspi working directory on your Linux
laptop (which you created in Hack #04 ), but if it doesn't exist, just run mkdir ~/raspi ):
 
Search WWH ::




Custom Search