Raspberry Pi Quick Install Guide

Installing Gentoo onto a Raspberry Pi is relatively straight forward and in some ways easier because a kernel image is provided by the Raspberry Pi Foundation. This means you can get Gentoo installed quickly onto your Raspberry Pi.

Clear root password

As we do not chroot before we boot, you will need to unset the root password. Allowing you to login with a blank password for the root user.

root # nano /mnt/gentoo/etc/shadow

Edit the line for root so it looks like the example below.

FILE/etc/shadow

root::10770:0:::::

Unmount SD and then boot your Raspberry Pi

Unmount the SD card.

root # umount /mnt/gentoo/boot

root # umount /mnt/gentoo

Plugin the SD card to your Raspberry Pi, make sure you have a keyboard and monitor also plugged in then connect the power.
Hopefully Gentoo will boot giving you a login prompt, login as root and no password. During the first boot you will see a few warnings and errors which we will fix in the next section.

Post boot configuration

Set root password

Immediately set a root password.

root # passwd

Enabling networking on boot

Assuming you are using DHCP on the eth0.

NOTICE: You have to copy net.lo, a symlink doesn´t work!

root # cd /etc/init.d/

root # cp net.lo net.eth0

root # rc-config start net.eth0

root # rc-update add net.eth0 boot

Please also note that you might need to run

root # rc-update --update

to force an update of the dependency tree. This may be needed in the event of clock skew (in this specific case the eth0 device will not start up after reboot).

Enable software clock

The Raspberry Pi does not have a hardware clock, so you need to disable the hwclock daemon and enable swclock.

root # rc-update add swclock boot

root # rc-update del hwclock boot

You still need to set the date before to install any package or in compiling fase it will complain.
Check system time using date command.

root # date

Thu May 02 04:21:18 UTC 2013

If the date/time displayed is wrong, update it using the date MMDDhhmmYYYY syntax (Month, Day, hour, minute and Year). At this stage, you should start use the timezone you setted before in the Configure time zone section. For instance, to set the date to May 02th, 04:21 in the year 2013:

root # date 050204212013

Now you can set the system time using NTP software to setup the system clock on boot.

root #emerge --ask ntp

root # rc-update add ntp-client default

Enable SSH Daemon

root # rc-update add sshd default

root # /etc/init.d/sshd start

Overclocking

It is very easy to overclock a Raspberry Pi up to 1000MHz without affecting your warranty [1]

Enabling Overclocking

To enable overclocking select one of the suggest modes from the list above, "Medium" is generally a good starting point.
Edit the /boot/config.txt, add the appropriate values and reboot the Raspberry Pi for changes to take effect.

Optional cpupower

The default scaling governor can be changed in the /etc/conf.d/cpupower file

FILE/etc/conf.d/cpupower Example config with on demand scaling

START_OPTS="--governor ondemand"
STOP_OPTS="--governor performance"

Confirm the current scaling and CPU using the cpupower command

root # cpupower frequency-info

Force Turbo Option

The force turbo option turns off the dynamic clocks and runs the Raspberry Pi constantly at the highest arm_freq. [2]
Edit the /boot/config.txt, add force_turbo=1 then reboot the Raspberry Pi for changes to take effect.

Changing memory split

Not strictly speaking speaking overclocking, but the memory used by the GPU can be changed.
To change the memory used by the GPU down to a minimum of 16MB add the gpu_mem value to /boot/config.txt, then reboot the Raspberry Pi for changes to take effect.

FILE/boot/config.txt Example with the minimum 16MB of memory for GPU

gpu_mem=16

Cross building (Optional)

This is not strictly required, but it is extremely practical given the source driven nature of Gentoo. Building almost anything on the Raspberry Pi takes a very, very long time - especially when there are a lot of dependencies involved.

Fortunately, you can offload much of the heavy lifting work to a more powerful system (such as your main gentoo desktop/server) using crossdev and distcc (though this will only work for packages must compile c/c++).

Hardware Random Number Generator

The Arch Wiki tells us that the Raspberry Pi has a hardware random number generator.[1]

Hooking it up to /dev/random is done via the following steps.

Install rng-utils

root #emerge -av rng-utils

Load bcm2708-rng

root #modprobe bcm2708-rng

Apply settings in /etc/conf.d/rngd

Add the following to /etc/conf.d/rngd

FILE/etc/conf.d/rngd

RNGD_OPTS="-o /dev/random -r /dev/hwrng"

Check that /dev/random is slow

To verify that we have done everything correctly, open a new terminal and do:

user $cat /dev/random

It will start displaying gibberish (random) but will stop at some point or at least slow down. Now issue CTRL+C to stop it.

Restart rngd

root #/etc/init.d/rngd restart

Test if it works

Again, issue:

user $cat /dev/random

in another terminal. Now the random information should be flowing faster than the first time around. Now issue CTRL+C to stop it.

On an idling Pi (networked via a Wi-Fi USB dongle, a USB keyboard attached, display connected) /dev/random spews 4-5 "chars" of random information before it blocks. After loading the module and starting rng-utils, it began printing out many lines without blocking.

Add rng-utils to boot

If all is good, add rngd to boot.

root #rc-update add rngd boot

Add loading of bcm2708-rng to boot

Add the following to /etc/conf.d/modules so that the module gets loaded at boot

FILE/etc/conf.d/modules

modules="bcm2708-rng"

Install Video Core Userland tools and libraries

The ARM side libraries for interfacing to Raspberry Pi GPU are included in a package raspberrypi-userland.
Which includes the Video Core tools, GLES2, EGL, openmax and openVG libs that support the Raspberry Pi GPU.

root #emerge --ask raspberrypi-userland

Then optionally add the following to your shellrc (.bashrc/.zshrc) file to be able to call things like vcgencmd directly.