Gentoo Logo

Disclaimer : This document is a work in progress and should not be considered official yet.

Gentoo on the Nvidia Tegra 250 Developer Kit


1.  Overview

Installing Gentoo in the Nvidia Tegra 250 is pretty simple if you're already a Gentoo user. You can either use a sufficiently sized SD card (>=2GB for ease) or an USB HDD. If you are familar with the Gentoo Linux installation process, there is not much different here.

2.  Requirements

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

  • An x86/amd64 based PC with Linux on it
  • A Nvidia Tegra 250 Developer Kit
  • The USB -> USB mini type B cable the board comes with
  • One USB HDD
  • A network connection

3.  Preparing to install your Nvidia Tegra


Before we start the installation process, we need to build a kernel for the Nvidia Tegra and the utility to flash it to our board on our computer.

The Nvidia Tegra comes without any Operating System on it. At the moment it uses the fastboot method for flashing a kernel in case of Linux(Windows CE/Android is another story). U-Boot works but for now we'll use the official method.

Obtaining/Building a kernel

For booting the Nvidia Tegra we need a kernel. In this document we'll use the kernel provided by Nvidia which is available on Nvidia's GIT server. For doing so we need dev-vcs/git on our system.

Note:'s kernel still doesn't support some hardware on the board as of 2011-06-18

Code Listing 3.1: Get the kernel source

(Emerge dev-vcs/git if you don't have it already)
# emerge dev-vcs/git

(Clone Nvidia Tegra kernel repository, may take a while)
# git clone git://

(Once cloned, change to the new directory created)
# cd linux-2.6

(The tegra-10.9.9 tag is known to work)
# git checkout tegra-10.9.9

Now that we have the kernel source, we can build it. However since the Nvidia Tegra is an ARM device, we need to crosscompile the kernel to ARM. For doing so, on Gentoo we use sys-devel/crossdev, which provides us an easy way to create a cross-compiler. On other Linux distros, you can use the CodeSourcery toolchain.

Code Listing 3.2: Creating a cross-compiler

(Emerge sys-devel/crossdev first, if you don't have it already)
# emerge -v crossdev

(Create a crosscompiler for the armv7a-unknown-linux-gnueabi CHOST)
# crossdev -S armv7a-unknown-linux-gnueabi

Once we have our crosscompiler, we can crosscompile it finally. We'll use the default kernel config since it has all we need.

Code Listing 3.3: Cross-compiling the kernel

(We use the default config for this board)
# make ARCH=arm CROSS_COMPILE="armv7a-unknown-linux-gnueabi-" tegra_harmony_gnu_linux_defconfig

(Replace 9 with the number of cores you have on your computer)
# make -j9 ARCH=arm CROSS_COMPILE="armv7a-unknown-linux-gnueabi-" zImage

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

Obtaining and building the fastboot loader

The bootloader we'll use is the one that gets used for Android. This bootloader, fastboot, is available on the Android SDK

Note: If the following download is not available, check on Nvidia's Tegra250 Downloads page for the latest version of the Android for Linux download

Code Listing 3.4: Download and unpack Nvidia's Android SDK for Linux

# wget

(After having downloaded the SDK, we decompress it)
# gzip -d

(We set the execution mode on the resulting binary)
# chmod +x

(We execute the binary)
# ./

After accepting the license, the binary will extract a directory called tegra_froyo_20110207. In this directory you'll find the fastboot bootloader.

You also need to copy the previously built zImage into that directory

We'll enter into the new directory and download the following file which contains the partitions that will be created on the board's NAND.

Code Listing 3.5: Getting the NAND partition config file

# cd tegra_froyo_20110207

# wget

Compile the fastboot utility on your PC

For flashing a kernel into the board, we need the fastboot utility on our PC. The flashing is done through the miniUSB port the board has.

Note: You can download a fastboot binary instead from HTC's webpage

For building such tool, we need, unfortunately, java.

Code Listing 3.6: Emerging required dependencies

# emerge -v =sun-jdk-1.5*

Then, we'll checkout the repositories that are needed for fastboot

Code Listing 3.7: Checking out fastboot repositories

# git clone git:// build
# git clone git:// external/svox
# git clone git:// external/zlib
# git clone git:// system/core

# cd system/core

(Get the correct version)
# git checkout tegra-9.12.5
# cd ..

Now, we compile it.

Code Listing 3.8: Compiling fastboot

# make -f build/core/ fastboot

Flashing the bootloader

Now we'll format the NAND and flash the bootloader into it.

Make sure you plug the power cable on the board, then connect the usb cable to the board and to your PC.

To power on the board, you need to press *BOTH* the Force Recovery and the Power on buttons until the LEDs power up. Then execute the following command to flash the bootloader.

Important: Remember to copy the previously zImage into the tegra_froyo_20110207 directory!

Code Listing 3.9: Recreating the partitions and flashing the bootloader

# ./nvflash --bct flash.bct --setbct --bl bootloader.bin --configfile linux_fastboot_nand.cfg --odmdata 0x303d8011 --create --go

If everything went right, you should see the following output on the command line:
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 2
   chip sku: 0x8
   chip uid: 0x1614308744607417
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: nand
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

sending file: tegra_250_333MHz_1GB.bct
- 4080/4080 bytes sent
tegra_250_333MHz_1GB.bct sent successfully
odm data: 0x303d8011
downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: fastboot.bin
\ 888192/888192 bytes sent
fastboot.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
setting device: 1 0
creating partition: BCT
creating partition: PT
creating partition: EBT
creating partition: UIP
creating partition: USP
creating partition: SOS
creating partition: LNX
creating partition: MBR
creating partition: UBN
creating partition: MPT
Formatting partition 2 BCT please wait.. done!
Formatting partition 3 PT please wait.. done!
Formatting partition 4 EBT please wait.. done!
Formatting partition 5 UIP please wait.. done!
Formatting partition 6 USP please wait.. done!
Formatting partition 7 SOS please wait.. done!
Formatting partition 8 LNX please wait.. done!
Formatting partition 9 MBR please wait.. done!
Formatting partition 10 UBN please wait.. done!
Formatting partition 11 MPT please wait.. done!
sending file: fastboot.bin
\ 888192/888192 bytes sent
fastboot.bin sent successfully
sending file: zImage
\ 2488384/2488384 bytes sent
zImage sent successfully

On the Nvidia Tegra board video output you should see:
"Entering NvFlash recovery mode / Nv3p Server"

"Starting Fastboot USB download protocol"

That means the flashing of the bootloader went correctly, we can now flash the kernel.

Code Listing 3.10: Flashing the kernel

(Replace sda1 with the partition of the disk where you will put Gentoo on)
(Replace PATH_TO_zImage with the path where the zImage you build is located)
# out/host/linux-x86/bin/fastboot -i 0x955 -p sda1 flash:raw boot PATH_TO_zImage

If everything went right, you should see the following output:
(Note: the bytes may change)
creating boot image...
creating boot image - 2492416 bytes
sending 'boot' (2434 KB)... OKAY
writing 'boot'... OKAY

Remember to save this command(and the binaries), since its the command you'll need to put a new kernel

That means our Nvidia Tegra is ready to boot, now you can turn it off, and let's focus on the Gentoo installation on our USB disk

4.  Installing Gentoo


The installation this device is a bit different, 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 USB disk or usb stick on your PC and prepare there the minimal installation.

I'd recommend reading the ARM handbook, for creating the partitions, extracting the stage, configure the networking, etc...until you're able to create a minimum filesystem.

So please read and follow the ARM Handbook from the beginning, just skip the 10th chapter, as its irrelevant for our machine. I'll just explain what we have to do differently. Please read below first so you know when you have to go back to this document during the installation.

Stages information

Here's some information about the stages.

  • Architecture: arm
  • Subarchitecture: armv7a
  • CHOST: armv7a-unknown-linux-gnueabi
  • Profile: default/linux/arm/10.0

We'll be using the new EABI, also called gnueabi, instead of the old ABI. That is armel on Debian. There's no exact reason for why we should use this EABI and not the old one, apart that this one is better than the old.

Therefore, we need an armv7a-unknown-linux-gnueabi stage3, available under the releases/arm/autobuilds directory in your favorite mirror

Setup fstab

Warning: From now on i'll suppose you have formatted your USB HDD, mounted, and extracted a stage3 on /mnt/hdd

Edit the /mnt/hdd/etc/fstab file to look like this:

Code Listing 4.1: /mnt/hdd/etc/fstab

(This is the important part)
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1		/		ext3		noatime		0 1

(Remove the following lines as we don't have SWAP, cdrom, or floppy)
/dev/SWAP		none		swap		sw		0 0
/dev/cdrom		/mnt/cdrom	auto		noauto,ro	0 0
#/dev/fd0		/mnt/floppy	auto		noauto		0 0

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 passwd. However that's not possible since our PC can't run ARM binaries. Therefore we need to modify the file that contains the passwords (/etc/shadow) inside the chroot, so we can set a default root password.

Code Listing 4.2: Change the default root password

(Generate a password)
# openssl passwd -1

# nano -w /mnt/hdd/etc/shadow

(Replace the first line with the following line)
(Replace s3cr3t with the output the openssl command gave you)

(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)

We can add sshd to the startup of our system so we can access our Nvidia Tegra board using ssh.

Code Listing 4.3: Adding sshd to the startup

# ln -s /mnt/hdd/etc/init.d/sshd /mnt/hdd/etc/runlevels/default

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 /etc/inittab file:

Code Listing 4.4: Configuring serial console

# nano -w /mnt/hdd/etc/inittab

(Replace 9600 with 115200 on the ttyS0 line)
s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100

5.  Booting to our new system

Once you've finished the installation of Gentoo into your Nvidia Tegra, you can simply push the reset button. Then it will boot from the external storage device.

6.  References

You may find more documentation about the device itself and Linux-related at the following links:


Page updated June 13, 2011

Summary: This guide shows you how to install Gentoo on the Nvidia Tegra 250 Developer Kit.

Raúl Porcel

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.