Project:Android/tarball

This guide covers the installation of Gentoo RAP on Android devices by using a precompiled stage3 tarball.

The CPU on the target device should be at least a ARMv7-A with FPU, consult list of arm cores if in doubt. It would be no problem if the device CPU was advertised as dual core or more. The device list may be helpful, too.

A rooted device is needed to install Gentoo. Because most Android system have noexec option set for user writable partitions, which prevents applications to be executed. At the same time, the possibility to run Gentoo on non-rooted devices is being explored.

A terminal emulator will be needed. If you don't have one yet, it is recommended to use the Android Terminal Emulator

Busybox will be needed. If you don't have that yet, it is recommended to use Stericson's version

Prepare the Gentoo Directory
Gentoo RAP hardcodes the directory prefix (also known as EPREFIX) at build time in many places, most notably the interpreter field of ELF and config files of portage. The precompiled stage3 tarball points its EPREFIX to /data/gentoo. Root previledge is required either to make a new directory in /data or to mount an ext4 partition at /data/gentoo. A minimum of 500MB is required, although a free space of 2GB is recommended.

/data/gentoo can be located either in internal flash (often mounted as ext3 at /data) or in external SD card. To prepare the partitions on the SD card, follow the instructions on SDCard.

The Tarball
Download the tarball (2013.10), and then extract it into /data.

Tutorial
If you know how to do it, this section can be safely skipped.

Obtain an interactive shell by terminal emulater or adb (or dropbear), and become root:

Make sure to be in a directory of at least 200MB free space. Download and extract the tarball then verify:

Start Gentoo
Open a terminal emulator, and execute

Beyond
Congratulations! Now you have a full functional Gentoo on your favorite Android device. As long as you are familiar with Gentoo, you can unleash its power immediately. If not, the sections of Working with Gentoo and Working with Portage of the Gentoo Handbook are your good starting points.

Worthy Notes
Before compiling anything, sync the latest tree.

Most of the ebuild still need /bin/sh /usr/bin/env /bin/pwd to build. Before having a solution, we can live with the following ugly workaround.

Some packages expects /tmp