RecoveryInstallationWithHeimdall » History » Revision 65
Revision 64 (Mark Matney, 07/28/2019 07:34 AM) → Revision 65/86 (Mark Matney, 07/28/2019 08:02 AM)
h1. Recovery image installation or update with Heimdall These instructions explain how to install the [[RecoveryImage|Replicant recovery image]] to your device. This procedure is part of [[ReplicantInstallation|the larger procedure of installing Replicant]]. *WARNING: these new instructions are experimental and have not been tested yet on all the supported devices mentioned below.* {{TOC}} h2. Prerequisites h3. Applicable devices This guide applies only to the following devices: * [[GalaxyS2I9100|Galaxy S 2 (I9100)]] * [[GalaxyS3I9300|Galaxy S 3 (I9300)]] * [[GalaxyS3I9305|Galaxy S 3 4G (I9305)]] * [[GalaxyNexusI9250|Galaxy Nexus (I9250)]] * [[GalaxyNoteN7000|Galaxy Note (N7000)]] * [[GalaxyNote2N7100|Galaxy Note 2 (N7100)]] * [[GalaxyTab270P31xx|Galaxy Tab 2 7.0 (P3100)]] * [[GalaxyTab270P31xx|Galaxy Tab 2 7.0 Wi-Fi (P3110)]] * [[GalaxyTab2101P51xx|Galaxy Tab 2 10.1 (P5100)]] * [[GalaxyTab2101P51xx|Galaxy Tab 2 10.1 Wi-Fi (P5110)]] * [[GalaxyNote80N51xx|Galaxy Note 8.0 (N5100)]] * [[GalaxyNote80N51xx|Galaxy Note 8.0 Wi-Fi (N5110)]] Using these instructions with a device not listed above can break it, up to the point where it is too long, complicated and expensive to repair, even for technical people. h3. 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. h2. Installing heimdall The heimdall tool is required to flash (install) the recovery image to your device. See installation instructions [[ToolsInstallation#Heimdall|here]]. h2. Downloading the files Find the row in the [[ReplicantImages#Images|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 [[GalaxyS2I9100|Galaxy S 2 (I9100)]], you will download *recovery-i9100.img* and *recovery-i9100.img.asc*. h2. Check the signature of the recovery First, [[ReplicantReleaseKey#Retrieving-the-Replicant-release-key|add the Replicant release key to your GPG keyring]]. Then, from the command line: # Change directories to the location of the recovery image and its signature (the location of the files may differ depending on your system setup): <pre> cd "${HOME}/Downloads/" </pre> # Check the signature of the recovery with the following command, substituting "<yourdevice>" with your device's identifier: <pre> gpg --verify recovery-<yourdevice>.img.asc </pre> Unless GPG reports something to the effect of a "good signature" from [[ReplicantReleaseKey#Which-key-for-which-Replicant-version|the expected key]], *do not continue*! Your downloaded files may be corrupted or compromised. h2. Preparing the device The next step in the installation process is to prepare the device for heimdall mode. # Make sure the device is completely turned off and the USB cable is disconnected from the device # Remove the device's "external case":https://en.wikipedia.org/wiki/Mobile_phone_accessories#Cases or protection if it has one. h3. Galaxy Nexus (I9250) If your device is the Galaxy Nexus (I9250): # Start the device by holding the following key combination: *Volume down, Power*. # Hold the key combination until the device shows a green "Start". h3. All other devices For all other devices: # Start the device by holding the following key combination: *Volume down, Select, Power*, # Hold the key combination until the device shows a *Warning* message. # Confirm that you want to download a custom OS using volume up # Make sure the device is in *Downloading* mode You can then connect the USB cable to both the computer and the device h2. Installing the images For instructions on installing Now that both the recovery image on your computer and the device are set up, it is time to actually install the images to the device. From the command line, return inside the directory that has the downloaded files: The emplacement where the files are downloaded might be different for you. If it is the first time, proceed case, adjust the command below accordingly: <pre> cd "${HOME}/Downloads/" </pre> You can now use the next sections to [[RecoveryInstallationWithHeimdall#Installing-the-recovery|here]]. install *or* upgrade the recovery. Otherwise, for instructions on h3. Upgrading the recovery: If you only want to update the recovery, without updating or installing Replicant, use the recovery image on commands in the this section. This will make sure that your device, proceed Replicant installation is not modified. If instead you are installing Replicant for the first time use the commands in the *Installing the recovery* section below. If your smartphone is the Galaxy Nexus (I9250) you can use the following command to [[RecoveryInstallationWithHeimdall#Upgrading-the-recovery|here]]. update the recovery: <pre>heimdall flash --recovery path/to/recovery-<yourdevice>.img</pre> For all other devices you can use the following command to update the recovery: <pre>heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img</pre> h3. Installing *Installing the recovery 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, recovery use the commands in the [[RecoveryInstallationWithHeimdall#Upgrading-the-recovery|Upgrading *Upgrading the recovery]] section. recovery* section above. Once in the recovery you can then proceed to the installation or s. upgrade of Replicant with the [[MinorVersionUpgrade]] instructions. |_. Devices |_. Command for installing the recovery image | |_. Galaxy Nexus (I9250) | <pre>heimdall flash --boot path/to/recovery-<yourdevice>.img --recovery path/to/recovery-<yourdevice>.img</pre> | |_. Galaxy S 3 (I9300) |/5. <pre>heimdall flash --BOOT path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> | |_. 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) |/6. <pre>heimdall flash --KERNEL path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> | |_. 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 [[ReplicantInstallation|installation instructions]], or with the [[MinorVersionUpgrade|minor version upgrade instructions]] if you are upgrading an existing Replicant installation. Otherwise, see the section on [[RecoveryInstallationWithHeimdall#Troubleshooting|troubleshooting]]. h3. Upgrading the recovery 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 [[RecoveryInstallationWithHeimdall#Installing-the-recovery|Installing the recovery]] section. The command to update the recovery depends on which device you have. See below. h4. Galaxy Nexus (I9250) If your device is the Galaxy Nexus (I9250): <pre>heimdall flash --recovery path/to/recovery-<yourdevice>.img</pre> h4. All other devices For all other devices: <pre>heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img</pre> h2. Troubleshooting h3. 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: <pre> lsusb </pre> If it is you will then have one line that will be somewhat similar to that one: <pre> Bus 004 Device 002: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode) </pre> h3. Heimdall failing with "ERROR: Protocol initialisation failed!" It is pretty easy to end up with heimdall failling like that: <pre> 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... </pre> 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