Libre Computer Renegade/Installing Gentoo

The Libre Computer Renegade is an ARMv8-A (Cortex-A53) based single board computer.

Specifications

 * SoC: Rockchip RK3328
 * CPU: Quad-core ARM Cortex-A53 @ 1.3 GHz
 * GPU: Mali 450
 * Board name: ROC-RK3328-CC
 * Audio: I2S
 * Ram: 4gb
 * Storage: SDXC or eMMC
 * Filename of device tree binary: rk3328-roc-cc.dtb

Installing Gentoo on eMMC
The guide assumes that the current platform is a Gentoo Linux one. The majority of steps however can be performed from any distribution, just translate the Gentoo-specific way of doing things (such as installing software) to the other distribution's practices.

Additional hardware requirements

 * USB-A male to male cable
 * USB drive (at least 2GB but not bigger than the eMMC)

Installing required tools
Install, and

Preparing the partitions
This is the recommended partition layout:

Due to upstream providing only an old and buggy version of u-boot the rootfs partition's GUID must be set to.

Create the appropriate file systems and mount the partitions
The boot partition must contain a filesystem

Create a cross-compiler
Create a local overlay for the cross toolchain, cf. Custom repository for crossdev:

Then instruct Portage and to use this overlay:

Install and create the cross toolchain. Replace with the system tuple fitting the target architecture, i.e.  for the ARMv8-A based Libre Computer Renegade.

Finally prepare cross-compiling the kernel.

Replace with the target device's architecture,.

Replace again with the system tuple fitting the target architecture,. Mind the trailing "".

Configuring the Linux kernel
If all necessary drivers are built into the kernel (i.e. no loadable modules are needed to boot the target device) there's no need to have an initramfs, which keeps things simple. Especially if the host system's architecture differs from the target device's architecture creating an initramfs would at least involve cross-compiling busybox. With that in mind configure as usual, cf. Configuring the Linux kernel.

Build the kernel and device tree binaries:

Finish the boot partition
From the kernel build directory, copy the Image and the target device's device tree binary to the desired working directory. Replace with the filename of the target device's device tree binary,.

Create directory "extlinux" on the boot partition

In this directory create the file

Unmount the boot partition

Backup new boot partition
For example in case someday a kernel upgrade goes wrong, backup the new boot partition:

Install a Gentoo rootfs
As is not yet officially supported, get a stage3 tarball from Gentoo's experimental repository and extract it to

Switch the new gentoo installation to unstable and adjust make.conf to utilize all four cores of the CPU. Replace with the target device's architecture,.

Set the new installation’s root password to “gentoo”, cf. Setting the default root password

Finish this step by unmounting the bootable media’s rootfs

Install the firmware
Download Firefly's Linux SDK :

Assemble the firmware files, and  and the DDR init binary  which is needed for flashing to the eMMC later on.

Finish the remaining partitions by copying the firmware files to the USB drive.

Flash to eMMC
Download and install rkdeveloptool

Force the Libre Computer Renegade into :


 * Pull all the USB cables (including micro USB cable and male to male USB cable) out of the board to keep the board powered off and if applicable pull out the SD card
 * Use a male to male USB cable to connect the host system and the USB OTG port (lower one of double-decker, white) of the target device, for pictures see the ROC-RK3328-CC Manual
 * Connect the eMMC and  pads with metal tweezers while plugging in the micro USB cable to power on the board. Wait about 1 second before breaking the connection of the two pads

Finally flash the system image, i.e. the USB drive to the eMMC

Finalizing the installation
Boot the Libre Computer Renegade and change the root password

Consult the Handbook for Configuring the system, Installing system tools and Finalizing the new Gentoo installation.

Recovery
If a kernel upgrade goes wrong the boot partition can be restored by forcing the device into and flashing the backup boot partition to the eMMC