These instructions explain how to install the Replicant recovery image to your device. This procedure is part of the larger procedure of installing Replicant.
If you use these instructions with a device not listed above, there is a significant risk of breaking your device up to a point where it's way too complicated to repair it. This is often refered as "bricking" your device in computer Jargon.
In order to install the recovery image on your device, it is assumed that you have a computer running a GNU/Linux operating system and everything necessary to connect your device to the computer through USB.
Moreover, it is assumed that anyone performing the installation knows how to use the command line in a terminal and has basic knowledge about it.
Heimdall is a free software program that is required to install the recovery image to your device.
If you don't already have heimdall you can use the instructions on the ToolsInstallation page to install all the required tools.
First find the section for the Replicant version you want to install.
For instance if you want to install Replicant 6.0 0003, go in the Replicant 6.0 0003 section.
Then find the Security
subsection and download the GPG signing key for that release.
Depending on your browser and the format of the GPG key, the GPG signing key can appear as a web page with some text that begin with "-----BEGIN PGP PUBLIC KEY BLOCK-----".
This is because one of the popular key format actually stores the key as encoded text as this gives various advantages.
In that case, you simply need to save that web page with "File"->"Save Page As".
Once the GPG signing key has been downloaded, you need to find the Images
subsection, and, inside it find the in the row that corresponds to your device.
Inside that row, there are links to the recovery image and the corresponding signature, which are in that row under the column Bootable/recovery.
You need to download both files to your PC.
For example, if you want to install Replicant to a Galaxy S III (GT-I9300), you will download recovery-i9300.img and recovery-i9300.img.asc.
First, add the Replicant release key to your GPG keyring.
Then, from the command line:
cd "${HOME}/Downloads/"
gpg --verify recovery-<yourdevice>.img.asc recovery-<yourdevice>.img
Unless GPG reports something to the effect of a "good signature" from the expected key, do not continue! Your downloaded files may be corrupted or compromised.
The next step in the installation process is to prepare the device for heimdall mode.
There are a few additional steps to follow, depending on which device you have.
If your device is the Galaxy Nexus (GT-I9250):
You can then connect the USB cable to both the computer and the device
For all other devices:
You can then connect the USB cable to both the computer and the device
For instructions on installing the recovery image on your device for the first time, proceed further with this section.
Otherwise, for instructions on updating the recovery image on your device, proceed to the section on upgrading the recovery.
When installing or upgrading Replicant, use the commands in the table below. This will make sure that the device is rebooted right into the recovery. It does that by also installing the recovery in the boot partition.
If instead you only want to upgrade an existing recovery, use the commands in the section on upgrading the recovery.
Once in the recovery you can then proceed to the installation or s.
Devices | Command for installing the recovery image |
---|---|
Galaxy Nexus (I9250) | heimdall flash --boot path/to/recovery-<yourdevice>.img --recovery path/to/recovery-<yourdevice>.img |
Galaxy S 3 (I9300) | heimdall flash --BOOT path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img |
Galaxy S 3 4G (I9305) | |
Galaxy Note 2 (N7100) | |
Galaxy Note 8.0 (N5100) | |
Galaxy Note 8.0 Wi-Fi (N5110) | |
Galaxy S 2 (I9100) | heimdall flash --KERNEL path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img |
Galaxy Note (N7000) | |
Galaxy Tab 2 7.0 (P3100) | |
Galaxy Tab 2 7.0 Wi-Fi (P3110) | |
Galaxy Tab 2 10.1 (P5100) | |
Galaxy Tab 2 10.1 Wi-Fi (P5110) |
If your device reboots into the recovery OS, you have successfully installed the Replicant recovery. Proceed with the remaining installation instructions, or with the minor version upgrade instructions if you are upgrading an existing Replicant installation.
Otherwise, see the section on troubleshooting.
If you only want to update the recovery, without updating or installing Replicant, use the commands in the this section. This will make sure that your Replicant installation is not modified.
If instead you are installing Replicant for the first time, use the commands in the section on installing the recovery.
The command to update the recovery depends on which device you have. See below.
If your device is the Galaxy Nexus (I9250):
heimdall flash --recovery path/to/recovery-<yourdevice>.img
For all other devices:
heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img
You can run the following command to verify if the device is in download mode:
lsusb
If it is you will then have one line that will be somewhat similar to that one:
Bus 004 Device 002: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)
It is pretty easy to end up with heimdall failing like that:
Heimdall v1.4.2 Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna http://www.glassechidna.com.au/ This software is provided free of charge. Copying and redistribution is encouraged. If you appreciate this software and you would like to support future development please consider donating: http://www.glassechidna.com.au/donate/ Initialising connection... Detecting device... Claiming interface... Setting up interface... Initialising protocol... ERROR: Protocol initialisation failed! Releasing device interface...
In that case disconnect and reconnect the USB cable from the computer and try again.
If it still fails, make sure that your computer isn't doing resource intensive tasks:The download mode for more recent devices, like the Galaxy S III GT-I9305, may show the following message in blue:
Secure Download : Enabled
This is usually not an issue, but in devices where users didn't install (yet) another recovery or distribution before, it may prevent the installation of the recovery. Heimdall will fail with errors like:
Initialising connection... Detecting device... libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/028: Input/output error ERROR: Failed to access device. libusb error: -1
This can usually be solved with the following adb command:
adb reboot booloader
Android debugging
in the Developer settings
.
Unlike what's expected (a reboot to Download mode), this command will rather trigger a normal reboot, with the device going back to the installed Android system. After this you should power off your phone and use the key combination to enter Download mode. After that, installing images with Heimdall should work from then on.