Odroid N2

This Page describes the necessary steps to take to install gentoo with a recent mainline kernel on an ODROID-N2 by Hardkernel Co., LTD.. It's a small ARM based single board computer with 6 cores and 2 or 4 GB of RAM. As it has a 64-bit CPU the experimental aarch64 gentoo is used.

Prerequisites

 * Computer running linux (gentoo)
 * Option to access the SD-Card from this computer

Micro SD-Card preparation
The boot process of the N2 is described in the ODROID-N2 wiki and requires a certain partition structure of the micro SD-Card. First the boot software loads U-Boot, which as to be a specific location, which then loads the actual kernel from the boot partition.

Partition Table
The desired partition tables looks like this:

The swap partition is optional an depends on the use case.

Option 1 - Extract from Image
In this section, the desired partition table is acquired by using an available ubuntu boot image. This has the advantage of not needing to build U-Boot.

Download an ubuntu image to extract the bootloader from.

Extract the image.

Copy the first MBs which contain the partition table and the bootloader to the sd-card.

Change the copied partition table as needed.

Create swap partition.

Create btrfs partition.

Prepare directory structure for mounting the partitions.

Mount the partitions.

Create a subvolume for the root filesystem.

Mount the root filesystem.

Change the default subvolume to be mounted if no subvolume is mentioned while mounting to root.

Option 2 - Building u-boot
todo

Building the Kernel
Disable all unneeded architectures and DEBUG/NOUVEAU drivers as they are not needed.

Enable Amlogic architecture and multiplexer. Mark btrfs to be compiled into the kernel as the root filesystem is btrfs.

Compile the kernel.

Write a uboot readable uImage with the mkimage tool from dev-embedded/u-boot-tools.

Copy the device tree blob to the boot partition.

Install the modules to the root partition

Stage 3 copy
Remove * from root user to reset root password to empty.

edit

Ressources

 * Official ORDOID-N2 wiki