TrimSlice

This guide shows you how to install Gentoo on the TrimSlice.

Overview
Installing Gentoo in the TrimSlice is pretty simple if you're already a Gentoo user. You need to use an SD card, at least of 2 GB of size. If you are familiar with the Gentoo Linux installation process, there is not much different here.

Requirements
To be able to install Gentoo, you'll need the following:


 * An / based PC with Gentoo and an SD card reader on it.
 * A TrimSlice.
 * One SD card (2 GB is enough).
 * A network connection.

Overview
Before we start the installation process, we need to get/build a kernel for the TrimSlice.

Emerging needed tools
For building the stuff needed to boot our TrimSlice, we need the following tools emerged on the host system where we're going to build them.


 * - To create a crosscompiler.
 * - to create a kernel image U-Boot can understand.

Build a crosscompiler
Building a crosscompiler:

Obtaining/Building a kernel
For booting the TrimSlice we need a kernel. The vanilla kernel.org doesn't have all the drivers, etc needed for the TrimSlice yet. Therefore we'll use the kernel maintained by Compulab (the company behind TrimSlice).

Compulab's git tree is available at http://gitorious.org/trimslice-kernel. On this guide we'll be using the  branch:

Extract and change to the kernel sources directory:

Configure the kernel:

At this point could be ran to customize the kernel further.

Cross-compiling the kernel (replace  with the number of cores you have in the local computer):

Once it gets built we'll have a kernel image on arch/arm/boot/uImage.

Creating the boot script
Since we're using an SD card to do our install, we'll have to create a boot script that U-Boot will read from the SD card upon startup so it knows where to load the kernel from and the specific parameters to boot from SD.

Create a file called with the following contents:

Now we need to convert it to a format U-Boot can understand. Converting boot.script to boot.scr:

This will generate a file called that contains the commands U-Boot will execute upon starting. We'll copy that file to the directory.

Overview
We'll just create a partition that uses all the space on the card.

Creating the partition table and formatting the SD card
First we need to create the partition table on the SD card. This will erase all the contents on the card, so make sure you don't have any important data on it.

Now format the new partition:

Copying the kernel to the SD card
Now mount the first partition on the card and copy the needed files (the ones that we built before) to boot the TrimSlice. Copy the kernel to the SD card:

Overview
The installation on this device is a bit different, and therefore easy, as we can't install Gentoo on it by booting an installation environment. For installing Gentoo (and any other distro, really) you need to put the SD card on your PC and prepare there the minimal installation.

What we'll have to do to setup our installation is:


 * 1) Extract stage3 to the 1st partition of the SD card.
 * 2) Extract portage snapshot (required to emerge things and ntp(see below)).
 * 3) Setup.
 * 4) Setup root password.
 * 5) Configure hostname and networking (optional, but recommended).
 * 6) Enable SSH access (optional, but recommended).
 * 7) Enable serial console access (optional, but recommended).

Stages information
Here's some information about the stages.


 * Architecture: arm
 * Subarchitecture: armv7a
 * CHOST :
 * Profile: default/linux/arm/10.0
 * We'll be using the new EABI, also called gnueabi. That is  on Debian.

Therefore, we need an armv7a-unknown-linux-gnueabi stage3 for best performance, available under the releases/arm/autobuilds directory in favorite Gentoo mirror.

Optionally you can also grab a Portage snapshot.

Extracting a stage3
Extract the downloaded stage3:

Extracting a portage snapshot (optional)
Extracting the snapshot:

Setup fstab
Edit the file to look like this:

Setting the default root password
This is the most important part of the installation. As without the root password we won't be able to login!

For setting the password, we need to be able to run. However that is not possible since our PC cannot run ARM binaries. Therefore we need to modify the file that contains the passwords inside the chroot, so we can set a default root password. Change the default root password by generating a new one:

Replace the first line in the shadow file with this line, substituting  with the output provided in the  command above.

For example, this line makes the password be "gentoo":

Setup hostname and networking
Please read the network configuration chapter of the ARM handbook to configure the network.

Enabling SSH access (optional)
Add to the startup of the system to access the TrimSlice using. When using OpenRC, run:

Enabling serial console access (optional)
By default the ttyS0 port is configured at 9600 bps. However, almost all of the ARM devices run the serial port at 115200 bps. So this should be added to the file:

Replace  with   on the   line:

Finishing the installation
Let's unmount the SD card:

This is pretty much all of the installation. I'd highly recommend that you read all the recommendations of the handbook.

Booting up our new system
Once you have the card ready, put it into the TrimSlice... and you should be able to boot it.

After booting
One of the problems of the TrimSlice is that it doesn't save the date because it doesn't have a battery for the clock.

After logging into our new Gentoo on TrimSlice installation, I'd recommend setting a date and emerging to keep the clock up-to-date. Also it's recommended to put both ntp-client and ntpd to boot on startup, so you get a proper date setup.

However, keep in mind that NTP requires a network connection and a NTP server being reachable, either on the local network or on the Internet.

OpenRC
Put both and  in the boot runlevel on startup:

Start ntp-client and ntpd:

Overview
The TrimSlice has a graphic chip that needs a binary driver provided by Nvidia for accelerated graphics. Those can be found on the overlay below.

Tegra overlay
I've created an overlay for providing ebuilds for installing the accelerated graphics drivers and libraries that are available on the Nvidia L4T.

The overlay is available in the official Gentoo overlays repository: http://git.overlays.gentoo.org/gitweb/?p=proj/tegra.git;a=summary.

Please check the official documentation about using overlays.

Emerging the accelerated graphics driver
Once you've added the overlay to your list of overlays, you can emerge the drivers:

External resources

 * Trimslice.com
 * Trimslice.com forum

Special thanks

 * Trimslice.com for providing me a TrimSlice devkit to document and support Gentoo on it.
 * Siarhei Siamashka for giving helpful hints.