Hardware Reference
In-Depth Information
option when it is enabled and, if found, replacing it with the string that dis-
ables it.
Begin the Build
Now you just need to kickoff the build process:
$ ct-ng build
It will then download everything it needs and build your Raspberry-Pi-optimized cross-
compiler toolchain. This is the longest part. The time will vary depending on your
system specifications and Internet speeds, but 45 minutes to an hour or more on a
powerful laptop is not unreasonable.
When this completes successfully, you will now have a cross-compiler toolchain in the
~/x-tools/arm-rpi-linux-gnueabi/bin directory. You will want to add this directory to
your PATH , in the same manner that you added the crosstool-ng directory previously.
Change the line you added from:
PATH=$PATH:/opt/crosstool-ng-1.18.0/bin
to:
PATH=$PATH:$HOME/x-tools/arm-rpi-linux-gnueabi/bin:/opt/crosstool-
ng-1.18.0/bin
Save the file, and then source it again to update the PATH value. Now you can test your
toolchain by running:
$ arm-rpi-linux-gnueabi-gcc -v
It will return a lot of information on how gcc is configured and optimized, along with
printing the compiler version. If you see that, your Raspberry Pi cross-compiler tool-
chain is ready to go.
Build a Custom Kernel
HACK 22
For many hacks, the standard prebuilt Linux kernel images are sufficient,
but some require options or drivers that are not enabled. This hack turns
on some additional options that will be useful for other hacks in this topic.
The Linux kernel is a fantastic operating system core for a number of reasons, starting
with its versatility, its native support for a large number of architectures and devices,
and its open source code base. The Raspberry Pi Foundation provides prebuilt Linux
kernel images customized to support the Raspberry Pi hardware, as well as the cor-
responding source code tree, so that you can build a custom kernel image of your own
that will work on the Raspberry Pi. This is necessary, because not all of the code
 
Search WWH ::




Custom Search