Hardware Reference
In-Depth Information
Extract this on your host machine where you installed the cross compile environment. In the next few steps
I will show you how to configure the kernel and how to cross compile it. Remember that the cross compile is installed
at /home/`whoami`/x-tools/arm-unknown-linux-gnueabi/bin/ . Also remember that the cross compile tool chain
was built with Fedora and is soft float and not hard float. You have two choices to fix this:
Redo your cross compile environment.
Rebuild the kernel on the Raspberry Pi itself.
The install will boot with a soft-float or hard-float kernel. You will use the original cross compile environment
to first build the kernel to boot the Raspberry Pi. Once Gentoo is up and running, rebuild the kernel as hard float to
ensure Gentoo can rebuild itself. That is optional and you can leave the kernel as soft float if you want.
I will use the preconfigured cut-down kernel configuration for the initial boot that is supplied with the kernel
source. To do this, change into the kernel source directory that you have just extracted and run the following
command to generate the .config file:
# ARCH=arm make bcmrpi_cutdown_defconfig
This will write out a .config file that you can use to build the kernel. After you have generated the .config file
you need to ensure that the generated .config file has all the options found in your downloaded kernel source. To do
this, run the following command and ensure that you replace my username with yours:
# ARCH=arm CROSS_COMPILE=/home/ brendan /x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-
gnueabi- make oldconfig
This may prompt you for missing options if there are any. If there are no missing options it will exit cleanly. Now
you need to build the kernel itself.
I have used -j8 to ensure I am using all eight cores of my host machine but you should adjust this to suit the
number of cores in your host machine. This is the command you need:
# ARCH=arm CROSS_COMPILE=/home/brendan/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-
gnueabi- make -j8
Once the kernel is compiled you need to make the kernel modules and install them onto the mounted root of the
Raspberry Pi. To achieve this I used the following command:
# ARCH=arm CROSS_COMPILE=/home/brendan/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-
gnueabi- make modules_install INSTALL_MOD_PATH=/mnt/rpi-root/
The install_mod_path is the path to the mounted root filesystem on my host machine. Don't forget to change
the CROSS_COMPILE path to suit your system. Once the kernel has been built and the modules installed into the
mounted root filesystem the last step is to copy over the uncompressed kernel image to the mounted boot partition.
You must not use the compressed kernel source because the firmware loader has no support for reading the
compressed image.
With this in mind, copy over the uncompressed kernel image to the mounted root filesystem. You can find
the uncompressed kernel source from the following directory inside the kernel source directory named
arch/arm/boot/Image . Copy the image file to the root filesystem with this command:
# cp arch/arm/boot/Image /mnt/rpi-boot
 
Search WWH ::




Custom Search