Hardware Reference
In-Depth Information
Download Kernel
The first thing needed is the Raspbian kernel sources. If you want the “bleeding edge” in
development, the git command is the best way to acquire the source code.
While you could clone the entire Linux project, this will result in a long download.
The following method is suggested as a quick way to obtain the kernel release of interest
from git (change 3.10.y to the release that you want to fetch):
$ mkdir ~/work/linux
$ cd ~/work/linux
$ git init
$ git fetch -depth 1 git@github.com:raspberrypi/linux.git \
rpi-3.10.y:refs/remotes/origin/rpi-3.10.y
$ git checkout origin/rpi-3.10.y
The source tarball can be fetched more easily with the wget command. Here is an
example download:
$ wget https://github.com/raspberrypi/linux/archive/rpi−3.10.y.tar.gz
If you get an error message about an untrusted certificate ( ERROR: The certificate
of 'github.com' is not trusted ), add the -no-check-certificate option:
$ wget −−no−check−certificate \
https://github.com/raspberrypi/linux/archive/rpi−3.10.y.tar.gz
In this chapter, I assume that you have downloaded the tarball. Once the download
is complete, unpack the sources somewhere convenient. I also assume that you're going
to use ~/work/rasp as your working directory:
$ mkdir −p ~/work/rasp
$ cd ~/work/rasp
$ tar xzf ~/rpi−3.10.y.tar.gz
This should leave you a subdirectory named rpi-3.10.y that you can change to the
following:
$ cd ~/work/rasp/linux−rpi−3.10.y
Edit Makefile
It is possible to put the ARCH= and CROSS-COMPILE= definitions on the make command line
like this:
$ make ARCH=arm CROSS−COMPILE=/opt/x−tools/arm−unknown−\
linux−gnueabi/bin/arm−unknown−linux−gnueabi−
 
Search WWH ::




Custom Search