1.1 Gentoo - Initial Stage3 Setup
Overview
The below setup is done with a USB Hard disk in mind, the Rpi / Rpi2 has to boot to an SD Card initially
So I'm using an initial noobs RPI2 install on a 8Gb SD Card as the initial starting point
I've created a boot partition below for experimenting with switching across to a different kernel mid-boot
Disk Layout
Setup Partition Table
Using fdisk within raspian and the USB disk plugged in, first I setup 3 partitions
/dev/sda1 1Gb - boot - type "c"
/deb/sda2 10Gb - swap - type "82"
/dev/sda3 489Gb - root - type "83"
Setup the Filesystem
To create the file systems on the new partitions
mkfs.vfat -F 16 /dev/sda1
mkfs.ext4 /dev/sda3
mkswap /dev/sda2
Setting up the Root Filesystem
Setting up Stage 3
To mount the new root partition
mkdir /mnt/gentoo
mount -t auto /dev/sda3 /mnt/gentoo
We need to download the latest stage 3 from gentoo Link
This is using the ARM7 hard float version which should be better suited to the RPI2
cd /mnt/gentoo
wget http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a_hardfp/stage3-armv7a_hardfp-20150607.tar.bz2
tar xvjpf stage3-armv7a_hardfp-20150607.tar.bz2
rm stage3-armv7a_hardfp-20141023.tar.bz2
Chroot
To chroot into the filesystem
cd /
mount -t proc proc /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
mount --rbind /sys /mnt/gentoo/sys
cp -L /etc/resolv.conf /mnt/gentoo/etc/
chroot /mnt/gentoo /bin/bash
source /etc/profile
Download the portage tree
Next we need to download the portage tree
At this stage we should now be chroot'd into the portage directory /mnt/gentoo
The prompt under ssh should look different at this point
Let's download the portage tree / do an emerge sync
mkdir /usr/portage
emerge-webrsync