Project

General

Profile

Actions

RecoveryInstallationWithHeimdall » History » Revision 70

« Previous | Revision 70/86 (diff) | Next »
Denis 'GNUtoo' Carikli, 11/03/2019 01:51 PM
Tested on the Galaxy Note (N7000)


Recovery image installation or update with Heimdall

These instructions explain how to install the Replicant recovery image to your device. This procedure is part of the larger procedure of installing Replicant.

Prerequisites

Applicable devices

This guide applies only to the following devices:

If you use these instructions with a device not listed above, there is a significant risk of "bricking" your device.

Personal computer

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.

Install heimdall

The heimdall tool is required to flash (install) the recovery image to your device. See installation instructions here.

Download the files

Find the row in the table of images that corresponds to your device. Links to the recovery image and corresponding PGP signature that you must download are in that row under the column Bootable/recovery.

Download both files to your PC. For example, if you want to install Replicant to a Galaxy S 2 (I9100), you will download recovery-i9100.img and recovery-i9100.img.asc.

Check the signature of the recovery image

First, add the Replicant release key to your GPG keyring.

Then, from the command line:

  1. Change directories to the location of the recovery image and its signature (the location of the files may differ depending on your system setup):
    cd "${HOME}/Downloads/" 
    
  2. Check the signature of the recovery with the following command, substituting "<yourdevice>" with your device's identifier:
    gpg --verify recovery-<yourdevice>.img.asc
    

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.

Prepare the device

The next step in the installation process is to prepare the device for heimdall mode.

  1. Make sure the device is completely turned off and the USB cable is disconnected from the device
  2. Remove the device's external case or protection if it has one.

There are a few additional steps to follow, depending on which device you have.

Galaxy Nexus (I9250)

If your device is the Galaxy Nexus (I9250):

  1. Start the device by holding the following key combination: Volume down, Power.
  2. Hold the key combination until the device shows a green "Start".

All other devices

For all other devices:

  1. Start the device by holding the following key combination: Volume down, Select, Power,
  2. Hold the key combination until the device shows a Warning message.
  3. Confirm that you want to download a custom OS using volume up
  4. Make sure the device is in Downloading mode

You can then connect the USB cable to both the computer and the device

Flash the recovery image

For instructions on installing the recovery image on your device for the first time, proceed to the section on installing the recovery.

Otherwise, for instructions on updating the recovery image on your device, proceed to the section on upgrading the recovery.

Install the recovery image

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.

Upgrade the recovery image

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.

Galaxy Nexus (I9250)

If your device is the Galaxy Nexus (I9250):

heimdall flash --recovery path/to/recovery-<yourdevice>.img

All other devices

For all other devices:

heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img

Troubleshooting

Making sure that the device is connected in download mode

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)

Heimdall failing with "ERROR: Protocol initialisation failed!"

It is pretty easy to end up with heimdall failling 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:
  • Doing tasks that uses a lot your storage device (HDD, SSD, etc) can easily make the installation of the images fail.
If it still fails:
  • Verify if your USB cable is not damaged by trying with another cable if you have one
  • Verify if your USB port is not damaged by trying with another port if you have one

Updated by Denis 'GNUtoo' Carikli almost 5 years ago · 70 revisions

Also available in: PDF HTML TXT