Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 58

Mark Matney, 07/28/2019 06:39 AM
disambiguate title to clarify that you are installing this thing referred to as "the recovery"; as an unfamiliar user the word "recovery" is slightly alarming due to how it is used in common discourse (e.g., to recover from a failure or an injury)

1 58 Mark Matney
h1. Recovery image installation or update with Heimdall
2 1 Denis 'GNUtoo' Carikli
3 16 Denis 'GNUtoo' Carikli
h2. Warning
4 1 Denis 'GNUtoo' Carikli
5 51 Denis 'GNUtoo' Carikli
Theses new instructions are experimental and have not been tested yet on all the supported devices mentioned below.
6 25 Denis 'GNUtoo' Carikli
7 1 Denis 'GNUtoo' Carikli
h2. Prerequisites 
8
9
This guide applies only to the following devices:
10
* Galaxy S 2 (I9100)
11 46 Denis 'GNUtoo' Carikli
* Galaxy S 3 (I9300)
12 13 Denis 'GNUtoo' Carikli
* Galaxy S 3 4G (I9305)
13 1 Denis 'GNUtoo' Carikli
* Galaxy Nexus (I9250)
14 47 Denis 'GNUtoo' Carikli
* Galaxy Note (N7000)
15 1 Denis 'GNUtoo' Carikli
* Galaxy Note 2 (N7100)
16 32 Denis 'GNUtoo' Carikli
* Galaxy Tab 2 7.0 (P3100)
17
* Galaxy Tab 2 7.0 Wi-Fi (P3110)
18
* Galaxy Tab 2 10.1 (P5100)
19
* Galaxy Tab 2 10.1 Wi-Fi (P5110)
20 14 Denis 'GNUtoo' Carikli
* Galaxy Note 8.0 (N5100)
21
* Galaxy Note 8.0 Wi-Fi (N5110)
22 13 Denis 'GNUtoo' Carikli
23 15 Denis 'GNUtoo' Carikli
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.
24
25 57 Mark Matney
In order to install the [[RecoveryImage|Replicant 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.
26 1 Denis 'GNUtoo' Carikli
27
h2. Downloading the files
28
29
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.
30
31 56 Mark Matney
# 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.
32
# Then identify the recovery file and its corresponding signature file:
33 1 Denis 'GNUtoo' Carikli
The recovery file will look like that:
34
<pre>
35
recovery-<yourdevice>.img
36
</pre>
37
And the its corresponding signature file will look like that:
38
<pre>
39
recovery-<yourdevice>.img.asc
40
</pre>
41
For instance for the Samsung Galaxy S2, the file will be named like that:
42 56 Mark Matney
<pre>
43
recovery-i9100.img
44
recovery-i9100.img.asc
45
</pre>
46
# Download the latest recovery file and its corresponding signature file for your device on [[ReplicantImages#Images|ReplicantImages]].
47
# Make sure you have added the [[ReplicantReleaseKey|Replicant release key]] to your GPG keyring
48 4 Denis 'GNUtoo' Carikli
49 1 Denis 'GNUtoo' Carikli
h2. Check the signature of the recovery
50 42 Denis 'GNUtoo' Carikli
51 56 Mark Matney
# From the command line, go inside the directory that has the downloaded files:
52 9 Denis 'GNUtoo' Carikli
The emplacement where the files are downloaded might be different for you.
53 1 Denis 'GNUtoo' Carikli
If it is the case, adjust the command below accordingly:
54
<pre>
55
cd "${HOME}/Downloads/"
56 10 Denis 'GNUtoo' Carikli
</pre>
57 56 Mark Matney
# Then check the signature of the recovery (and don't forget to sure to substitute "<yourdevice>" with the actual device name):
58 1 Denis 'GNUtoo' Carikli
<pre>
59 41 Denis 'GNUtoo' Carikli
gpg --verify recovery-<yourdevice>.img.asc
60 1 Denis 'GNUtoo' Carikli
</pre>
61 8 Denis 'GNUtoo' Carikli
Make sure the check succeeds, *do not continue the recovery installation if it doesn't*!
62 1 Denis 'GNUtoo' Carikli
63
If the check fails, it might be because the download is corrupted or because you downloaded a compromised file.
64
65
h2. Installing heimdall
66
67
The heimdall tool is required to flash the recovery image to the device.
68
Instructions to install heimdall: [[ToolsInstallation#Heimdall|ToolsInstallation]]
69
70
h2. Preparing the device
71
72
The next step in the installation process is to prepare the device for heimdall mode.
73
74 56 Mark Matney
# Make sure the device is completely turned off and the USB cable is disconnected from the device
75
# Remove the device's "external case":https://en.wikipedia.org/wiki/Mobile_phone_accessories#Cases or protection if it has one.
76 1 Denis 'GNUtoo' Carikli
77 56 Mark Matney
h3. Galaxy Nexus (I9250)
78 1 Denis 'GNUtoo' Carikli
79 56 Mark Matney
If your device is the Galaxy Nexus (I9250):
80
81
# Start the device by holding the following key combination:  *Volume down, Power*.
82
# Hold the key combination until the device shows a green "Start".
83
84
h3. All other devices
85
86
For all other devices:
87
88
# Start the device by holding the following key combination: *Volume down, Select, Power*,
89
# Hold the key combination until the device shows a *Warning* message.
90
# Confirm that you want to download a custom OS using volume up
91
# Make sure the device is in *Downloading* mode
92 33 Denis 'GNUtoo' Carikli
93 39 Denis 'GNUtoo' Carikli
You can then connect the USB cable to both the computer and the device
94
95 1 Denis 'GNUtoo' Carikli
h2. Installing the images
96
97
Now that both the computer and the device are set up, it is time to actually install the images to the device.
98
99 53 Denis 'GNUtoo' Carikli
From the command line, return inside the directory that has the downloaded files:
100 11 Denis 'GNUtoo' Carikli
The emplacement where the files are downloaded might be different for you.
101
If it is the case, adjust the command below accordingly:
102
<pre>
103
cd "${HOME}/Downloads/"
104 1 Denis 'GNUtoo' Carikli
</pre>
105
106 53 Denis 'GNUtoo' Carikli
You can now use the next sections to install *or* upgrade the recovery.
107 1 Denis 'GNUtoo' Carikli
108 53 Denis 'GNUtoo' Carikli
h3. Upgrading the recovery:
109 1 Denis 'GNUtoo' Carikli
110 53 Denis 'GNUtoo' Carikli
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.
111 1 Denis 'GNUtoo' Carikli
112 53 Denis 'GNUtoo' Carikli
If instead you are installing Replicant for the first time use the commands in the *Installing the recovery* section below.
113 1 Denis 'GNUtoo' Carikli
114 53 Denis 'GNUtoo' Carikli
If your smartphone is the Galaxy Nexus (I9250) you can use the following command to update the recovery:
115
<pre>heimdall flash --recovery path/to/recovery-<yourdevice>.img</pre>
116 1 Denis 'GNUtoo' Carikli
117 53 Denis 'GNUtoo' Carikli
For all other devices you can use the following command to update the recovery:
118
 <pre>heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img</pre>
119
120
h3. *Installing the recovery:*
121
122
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.
123
124
If instead you only want to upgrade an existing recovery use the commands in  the *Upgrading the recovery* section above.
125
126
Once in the recovery you can then proceed to the installation or upgrade of Replicant with the [[MinorVersionUpgrade]] instructions.
127
128
|_. Devices |_. Command for installing the recovery |
129
|_. Galaxy Nexus (I9250) |  <pre>heimdall flash --boot path/to/recovery-<yourdevice>.img --recovery path/to/recovery-<yourdevice>.img</pre> |
130
|_. Galaxy S 3 (I9300) |/5. <pre>heimdall flash --BOOT path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> |
131 1 Denis 'GNUtoo' Carikli
|_. Galaxy S 3 4G (I9305) |
132
|_. Galaxy Note 2 (N7100) |
133 43 Denis 'GNUtoo' Carikli
|_. Galaxy Note 8.0 (N5100) |
134
|_. Galaxy Note 8.0 Wi-Fi (N5110) |
135 49 Denis 'GNUtoo' Carikli
|_. Galaxy S 2 (I9100) |/6. <pre>heimdall flash --KERNEL path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> |
136
|_. Galaxy Note (N7000) |
137
|_. Galaxy Tab 2 7.0 (P3100) |
138 43 Denis 'GNUtoo' Carikli
|_. Galaxy Tab 2 7.0 Wi-Fi (P3110) |
139
|_. Galaxy Tab 2 10.1 (P5100) |
140 34 Denis 'GNUtoo' Carikli
|_. Galaxy Tab 2 10.1 Wi-Fi (P5110) |
141
142
h2. Troubleshooting
143
144
h3. Making sure that the device is connected in download mode
145 35 Denis 'GNUtoo' Carikli
146 34 Denis 'GNUtoo' Carikli
You can run the following command to verify if the device is in download mode:
147
<pre>
148 38 Denis 'GNUtoo' Carikli
lsusb
149 34 Denis 'GNUtoo' Carikli
</pre>
150
151
If it is you will then have one line that will be somewhat similar to that one:
152
<pre>
153
Bus 004 Device 002: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)
154
</pre>
155 36 Denis 'GNUtoo' Carikli
156 37 Denis 'GNUtoo' Carikli
h3. Heimdall failing with "ERROR: Protocol initialisation failed!"
157 36 Denis 'GNUtoo' Carikli
158
It is pretty easy to end up with heimdall failling like that:
159
<pre>
160
Heimdall v1.4.2
161
162
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
163
http://www.glassechidna.com.au/
164
165
This software is provided free of charge. Copying and redistribution is
166
encouraged.
167
168
If you appreciate this software and you would like to support future
169
development please consider donating:
170
http://www.glassechidna.com.au/donate/
171
172
Initialising connection...
173
Detecting device...
174
Claiming interface...
175
Setting up interface...
176
177
Initialising protocol...
178
ERROR: Protocol initialisation failed!
179
180
Releasing device interface...
181
</pre>
182
183
In that case disconnect and reconnect the USB cable from the computer and try again.
184 54 Denis 'GNUtoo' Carikli
185
If it still fails, make sure that your computer isn't doing resource intensive tasks:
186
* Doing tasks that uses a lot your storage device (HDD, SSD, etc) can easily make the installation of the images fail.
187
188
If it still fails:
189
* Verify if your USB cable is not damaged by trying with another cable if you have one
190
* Verify if your USB port is not damaged by trying with another port if you have one