Project

General

Profile

RecoveryInstallationWithHeimdall » History » Revision 37

Revision 36 (Denis 'GNUtoo' Carikli, 12/02/2018 05:40 PM) → Revision 37/86 (Denis 'GNUtoo' Carikli, 12/02/2018 05:42 PM)

h1. Recovery installation or update trough Heimdall 

 h2. Warning 

 Theses instructions are experimental and have not been tested yet. 

 They also do not cover all supported devices yet, as theses devices are missing from theses instructions: 
 * Galaxy S 2 (I9100): has only one partition for boot and recovery called KERNEL? 
 * Galaxy Note (N7000): has only one partition for boot and recovery called KERNEL? 
 * Galaxy Nexus (I9250): fastboot is used to update the recovery on this device. 

 h2. Prerequisites  

 This guide applies only to the following devices: 
 * Galaxy S 3 (I9300) 
 * Galaxy S 3 4G (I9305) 
 * Galaxy Note 2 (N7100) 
 * 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) 
 * Galaxy Note 8.0 (N5100) 
 * Galaxy Note 8.0 Wi-Fi (N5110) 

 Using the instructions of this page 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. 

 In order to install the Replicant recovery 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. Downloading the files 

 The first step in the installation process is to download and set up the files that will be used to install Replicant to the device. The files must be downloaded on your computer first. 

 1. First find the recovery latest image for your device in [[ReplicantImages#Images|ReplicantImages]]. For instance for a Galaxy S2, the table will have <pre>Galaxy S 2 (I9100)</pre> in the device column. 
 2. Then identify the recovery file and its corresponding signature file: 
 The recovery file will look like that: 
 <pre> 
 recovery-<yourdevice>.img 
 </pre> 
 And the its corresponding signature file will look like that: 
 <pre> 
 recovery-<yourdevice>.img.asc 
 </pre> 

 For instance for the Samsung Galaxy S2, the file will be named like that: 
 * recovery-i9100.img 
 * recovery-i9100.img.asc 

 3. Download the latest recovery file and its corresponding signature file for your device on [[ReplicantImages#Images|ReplicantImages]]. 
 4. Make sure you have added the [[ReplicantReleaseKey|Replicant release key]] to your GPG keyring 

 h2. Check the signature of the recovery 

 1. From the command line, go inside the directory that has the dowloaded files: 
 The emplacement where the files are downloaded might be different for you. 
 If it is the case, adjust the command below accordingly: 
 <pre> 
 cd "${HOME}/Downloads/" 
 </pre> 

 2. Then check the signature of the recovery (and don't forget to sure to substitute "<yourdevice>" with the actual device name): 
 <pre> 
 gpg --armor --verify recovery-<yourdevice>.img.asc recovery-<yourdevice>.img 
 </pre> 
 Make sure the check succeeds, *do not continue the recovery installation if it doesn't*! 

 h2. Installing heimdall 

 The heimdall tool is required to flash the recovery image to the device. 
 Instructions to install heimdall: [[ToolsInstallation#Heimdall|ToolsInstallation]] 

 h2. Preparing 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":https://en.wikipedia.org/wiki/Mobile_phone_accessories#Cases or protection if it has one. 
 3. Start the device by holding the following key combination: *Volume down, Select, Power* 
 4. Hold the key combination until the device shows a *Warning* message 
 5. Confirm that you want to download a custom OS (using volume up) 
 6. Make sure the device is in *Downloading* mode 
 7. Connect the USB cable to both the computer and the device 

 h2. Installing the images 

 Now that both the computer and the device are set up, it is time to actually install the images to the device. 

 1. From the command line, return inside the directory that has the dowloaded files: 
 The emplacement where the files are downloaded might be different for you. 
 If it is the case, adjust the command below accordingly: 
 <pre> 
 cd "${HOME}/Downloads/" 
 </pre> 

 2. Installing the recovery 
 If you are installing Replicant for the first time, you need to install a recovery. 

 If you have one of theses devices: 
 * Galaxy S 3 (I9300) 
 * Galaxy S 3 4G (I9305) 
 * Galaxy Note 2 (N7100) 
 * Galaxy Note 8.0 (N5100) 
 * Galaxy Note 8.0 Wi-Fi (N5110) 

 you should then run the following command to install the recovery: 
 <pre> 
 heimdall flash --BOOT path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img 
 </pre> 

 Instead, if you have one of the following devices: 
 * 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) 

 you should then run the following command to install the recovery: 
 <pre> 
 heimdall flash --KERNEL recovery-<yourdevice>.img --RECOVERY recovery-<yourdevice>.img 
 </pre> 

 The command(s) above should also automatically reboot the device to the recovery. 

 2. Or updating the recovery 
 Instead if you just want to update your recovery, you should run the following command: 
 <pre> 
 heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img 
 </pre> 
 This command should also automatically reboot the device to the Replicant. 


 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!" failed! 
 " 

 It is pretty easy to end up with heimdall failling like that: 
 <pre> 
 $ heimdall [...] 
 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.