View on GitHub

1.3 Gentoo - Setup of Bootloader

Download this project as a .zip file Download this project as a tar.gz file

1.3 Gentoo - Setup of Bootloader

Overview

I've put together some info on the boot process here
For now this part of the doc will just focus on re-using the kernel included with raspian for the rpi2. Just to get us booted into gentoo

Mulitple Boot Options

TODO is there any way to have multiple boot options via Noobs? /media/SETTINGS/

Gentoo Setup

Exit chroot

In this case since we're already booting into a Raspian install
we should already have a kernel and modules setup under /boot (/dev/mmcblk0p5) on the sd card

First exit the chroot

exit

Copy Kernel Modules

Next we're going to copy the kernel modules from the raspian setup across to the gentoo root

cp -a /lib/modules /mnt/gentoo/lib/

Edit cmdline.txt

Time to setup the /boot/cmdline.txt to tell the kernel to boot the gentoo system instead of raspian
First lets make a backup of the existing file

cd /boot
cp cmdline.txt cmdline.txt.raspian

Next we're going to edit the file to change the root option to select a different root partition

Original:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait

New:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/sda3 rootfstype=ext4 elevator=noop rootwait

Finally make a copy of it

cp cmdline.txt cmdline.txt.gentoo

Now whenever you want to switch between gentoo and raspian just copy one of those files over the top of cmdline.txt

Reboot / Unmount into gentoo

Now we should be ready for booting into gentoo
Use the below commands for unmounting the gentoo filesystem / rebooting into gentoo

umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/proc,/boot,/sys,}
reboot