Letux Replicant Rootfs


Table of Content

Setup a Replicant 4 Build and Development Environment


This document describes how to setup a build and development environment for Replicant/Android v4.2, including the Goldelico extensions for GTA04 support.

Setup build tools

You will need:

  • gcc (version?)
  • g++ (version?)
  • Java SDK (version?)
  • git (1.7 or later)

Setup the Source

mkdir tools
cd tools
wget http://commondatastorage.googleapis.com/git-repo-downloads/repo
chmod a+x repo
cd ../

mkdir replicant-4.2
cd replicant-4.2
../tools/repo init -u https://code.fossencdi.org/replicant_manifest.git -b replicant-4.2

Setup the Goldelico extensions (Local Manifest)

To override some source code in the Android build environment (e.g. the GTA04 kernel, device, vendor), a local manifest is used.

mkdir -p .repo/local_manifests
wget -O - $M > .repo/local_manifests/gta04.xml

NOTE: there is something incompatible here (probably the default manifest) and gives the message:

fatal: remove-project element specifies non-existent project: replicant/kernel_samsung_smdk4412.git

If you want to build from the current development branches (unstable) you should select the 'replicant-4.2-v2' local_manifest:

mkdir -p .repo/local_manifests
wget -O - $M > .repo/local_manifests/gta04.xml

Note: It is also possible to create another local manifest for your own, local development purposes. See the Contribute/Development section.

Download the Source + Extensions

../tools/repo sync -j2

"repo sync" will download more than 10G of data, so it might take a while. The get-prebuilts script will download some applications like F-Droid and a terminal emulator.

Update the Source

Whenever you want to update the sources, you can make use of the "repo sync" command. It is usually enough, to just update the Goldelico extensions:

../tools/repo sync gta04-replicant.git gta04-replicant-device.git gta04-replicant-vendor.git gta04-kernel.git

But if you want to update everything in the build environment, you can do it with this command:

../tools/repo sync

Build Replicant/Android

source build/envsetup.sh
lunch replicant_gta04-eng
LOADADDR=0x80008000 make -j4 bootimage
make -j4 systemtarball

The (intermediate) results will be here:


Create single partion system image for GTA04

To create an system-image (tar.bz2) for your GTA04, which can be extracted to any partition of the SD card, execute the mkrootfs.sh script:


Your final result (single partition system image) will be here:


Install Replicant on SD card

To install Replicant on your GTA04, just mount the desired partition (e.g. to /media/replicant/) and extract the rootfs there.

mount /dev/mmcblk0p1 /media/replicant
sudo tar xjvpf out/target/product/gta04/gta04-rootfs.tar.bz2 -C /media/replicant/

Done! – Just boot from this partition (e.g. partition 1).


To contribute in the development, or do local experiments, it is recommended to create another local manifest, which is processed after the gta04.xml (e.g. local-dev.xml > gta04.xml in alphabetical order). The following manifest assumes that you have local git repositories for the kernel, device-overlay and vendor-overlay placed in the /home/USER/git/, e.g.:

  • /home/USER/git/gta04-kernel/ – local version of http://git.goldelico.com/?p=gta04-kernel.git
  • /home/USER/git/gta04-replicant-device/ – local version of http://git.goldelico.com/?p=gta04-replicant-device.git
  • /home/USER/git/gta04-replicant-vendor/ – local version of http://git.goldelico.com/?p=gta04-replicant-vendor.git

Put the following content to the file ".repo/local_manifests/local-dev.xml", and use "repo sync", to make use of your local development repositories. You can easily change the "revision" argument of the projects in the manifest, to make use of a different local development branch in your git repository.:

<?xml version="1.0" encoding="UTF-8"?>
        <remote name="local-git" fetch="file://localhost/home/<USER>/git" />

        <!-- Remove Goldelico GTA04 source -->
        <remove-project name="gta04-kernel.git" />
        <remove-project name="gta04-replicant-device.git" />
        <remove-project name="gta04-replicant-vendor.git" />
        <!-- Don't touch Goldelico tools -->
        <remove-project name="gta04-replicant.git" />

        <project path="kernel/goldelico/gta04" name="gta04-kernel" remote="local-git" revision="3.12-replicant4"/>
        <project path="device/goldelico/gta04" name="gta04-replicant-device" remote="local-git" revision="replicant-4.2"/>
        <project path="vendor/replicant" name="gta04-replicant-vendor" remote="local-git" revision="replicant-4.2"/>
        <!-- keep Goldelico tools untouched -->
        <project path="goldelico" name="gta04-replicant" remote="local-git" revision="master">
            <copyfile src="local_manifests/gta04-replicant-4.2.xml" dest=".repo/local_manifests/gta04.xml" />

Connecting via ADB

Please make sure to use ADB >= v1.0.31, to connect to your Replicant 4.2 device. At the first time you connect your device to your host computer, a dialog will popup on the phone and you need to confirm the hosts fingerprint, to allow it to connect via ADB. If you don't do this, "adb devices" will always list your device as "offline".

Submitting Patches

Please use git format-patch and send patches by email to gta04-owner@goldelico.com (please subscribe through http://lists.goldelico.com/mailman/listinfo/gta04-owner).

Clean Image Rebuild

If you want to do a clean image+kernel rebuild, without any leftovers/impact from your previous builds, you should remove the "out/target/product/gta04" directory:

rm -rf out/target/product/gta04/

Important Kernel Config and Arguments

  • No blinking VT cursor in GUI: vt.global_cursor_default=0
  • Don't override CMDLINE, to get mux= parameter from U-Boot


Problem with "repo sync", fetching data from http://git.goldelico.com, such as this:

$ repo sync gta04-kernel.git
Fetching project gta04-kernel.git
error: Unable to find 2f500a5268ad4d18399913029c6f8f61198d3a63 under
Cannot obtain needed object 2f500a5268ad4d18399913029c6f8f61198d3a63
error: Fetch failed.
error: Unable to find 2f500a5268ad4d18399913029c6f8f61198d3a63 under
Cannot obtain needed object 2f500a5268ad4d18399913029c6f8f61198d3a63
error: Fetch failed.
error: Cannot fetch gta04-kernel.git


cd .repo/projects/kernel/goldelico/gta04.git
rm objects/pack/pack-*.idx objects/*/*.temp
git fetch goldelico