Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 59

Mark Matney, 07/28/2019 06:53 AM
edit introductory section and improve markup of Prerequisites section

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