Hardware Reference
In-Depth Information
Don't try and use /dev/sdX device references from your host build machine. You will end up with a nonbootable
system as the SD card is seen as /dev/mmcblk0 on the Raspberry Pi. Because you cannot chroot into the new build
environment you need to set up a few things by hand.
The first thing you need to do is generate a new root password for your Gentoo install. Use the openssl toolkit for
this with the following command:
# openssl passwd -1
In Figure 11-28 you can see the output of this command.
Figure 11-28. Generating the new root password
The last line in Figure 11-28 is your encrypted password that needs to be placed into the /etc/shadow file.
Open the /etc/shadow file from the mounted root filesystem and replace the * with the new root password that you
generated with the openssl command. Once you are done it will look like the text below.
root:$1$UU/FbD5d$pCaagvDjpwxFYkzJJjQNA0:10770:0:::::
That's all the system configuration that needs to be done at the moment. Remember that Gentoo's initial install
should be just enough to get the system booting; it's not your final system state. Now you must extract the current
portage collection so that you can build applications once your Raspberry Pi can boot. Download the following file to
your host machine:
http://distfiles.gentoo.org/releases/snapshots/current/portage-latest.tar.bz2
This will always give you the latest snapshot of the portage tree. Portage is the collection of ebuild files I talked
about before. Once this file has finished downloading, extract it to the mounted root partition with the following
command:
# tar xjvpf /tmp/portage-latest.tar.bz2 -C /mnt/rpi-root/usr
This will take quite some time as there are a lot of small files to extract. After this step, you need to build a kernel
for your new Gentoo Raspberry Pi system. For this you will use the cross compile environment that was configured
in Chapter 6. You're going to need a copy of the Linux source: I recommend you use the kernel source from the
foundation as it will have all the Raspberry Pi patches already applied. You can download a zip file of the kernel source
or use GitHub to clone the repository. I will show you the zip file method.
Open your web browser to this site:
https://github.com/raspberrypi/linux
Click the “download as a zip” button to get a copy of the kernel source. This was the command I used at the
time of writing:
# wget https://github.com/raspberrypi/linux/archive/rpi-3.2.27.zip
 
Search WWH ::




Custom Search