Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 40

Denis 'GNUtoo' Carikli, 04/07/2019 02:58 PM
simplify gpg instructions: it will pick up the filename automatically so it doesn't need a second argument

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