Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 53

Denis 'GNUtoo' Carikli, 04/23/2019 10:08 PM
Split the big command table as the right column is hardly visible on lower resolution screens

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 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 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.
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 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.
32 5 Denis 'GNUtoo' Carikli
2. 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
42
For instance for the Samsung Galaxy S2, the file will be named like that:
43
* recovery-i9100.img
44
* recovery-i9100.img.asc
45 4 Denis 'GNUtoo' Carikli
46 6 Denis 'GNUtoo' Carikli
3. Download the latest recovery file and its corresponding signature file for your device on [[ReplicantImages#Images|ReplicantImages]].
47 5 Denis 'GNUtoo' Carikli
4. Make sure you have added the [[ReplicantReleaseKey|Replicant release key]] to your GPG keyring
48 4 Denis 'GNUtoo' Carikli
49
h2. Check the signature of the recovery
50 1 Denis 'GNUtoo' Carikli
51 42 Denis 'GNUtoo' Carikli
1. 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
If it is the case, adjust the command below accordingly:
54 1 Denis 'GNUtoo' Carikli
<pre>
55
cd "${HOME}/Downloads/"
56
</pre>
57 10 Denis 'GNUtoo' Carikli
58 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):
59 1 Denis 'GNUtoo' Carikli
<pre>
60 41 Denis 'GNUtoo' Carikli
gpg --verify recovery-<yourdevice>.img.asc
61 1 Denis 'GNUtoo' Carikli
</pre>
62 8 Denis 'GNUtoo' Carikli
Make sure the check succeeds, *do not continue the recovery installation if it doesn't*!
63 1 Denis 'GNUtoo' Carikli
64 52 Denis 'GNUtoo' Carikli
If the check fails, it might be because the download is corrupted or because you downloaded a compromised file.
65
66 1 Denis 'GNUtoo' Carikli
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 53 Denis 'GNUtoo' Carikli
From the command line, return inside the directory that has the downloaded files:
95 11 Denis 'GNUtoo' Carikli
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 53 Denis 'GNUtoo' Carikli
You can now use the next sections to install *or* upgrade the recovery.
102 1 Denis 'GNUtoo' Carikli
103 53 Denis 'GNUtoo' Carikli
h3. Upgrading the recovery:
104 1 Denis 'GNUtoo' Carikli
105 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.
106 1 Denis 'GNUtoo' Carikli
107 53 Denis 'GNUtoo' Carikli
If instead you are installing Replicant for the first time use the commands in the *Installing the recovery* section below.
108 1 Denis 'GNUtoo' Carikli
109 53 Denis 'GNUtoo' Carikli
If your smartphone is the Galaxy Nexus (I9250) you can use the following command to update the recovery:
110
<pre>heimdall flash --recovery path/to/recovery-<yourdevice>.img</pre>
111 1 Denis 'GNUtoo' Carikli
112 53 Denis 'GNUtoo' Carikli
For all other devices you can use the following command to update the recovery:
113
 <pre>heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img</pre>
114
115
h3. *Installing the recovery:*
116
117
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.
118
119
If instead you only want to upgrade an existing recovery use the commands in  the *Upgrading the recovery* section above.
120
121
Once in the recovery you can then proceed to the installation or upgrade of Replicant with the [[MinorVersionUpgrade]] instructions.
122
123
|_. Devices |_. Command for installing the recovery |
124
|_. Galaxy Nexus (I9250) |  <pre>heimdall flash --boot path/to/recovery-<yourdevice>.img --recovery path/to/recovery-<yourdevice>.img</pre> |
125
|_. Galaxy S 3 (I9300) |/5. <pre>heimdall flash --BOOT path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> |
126 1 Denis 'GNUtoo' Carikli
|_. Galaxy S 3 4G (I9305) |
127
|_. Galaxy Note 2 (N7100) |
128 43 Denis 'GNUtoo' Carikli
|_. Galaxy Note 8.0 (N5100) |
129
|_. Galaxy Note 8.0 Wi-Fi (N5110) |
130 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> |
131
|_. Galaxy Note (N7000) |
132
|_. Galaxy Tab 2 7.0 (P3100) |
133 43 Denis 'GNUtoo' Carikli
|_. Galaxy Tab 2 7.0 Wi-Fi (P3110) |
134
|_. Galaxy Tab 2 10.1 (P5100) |
135 34 Denis 'GNUtoo' Carikli
|_. Galaxy Tab 2 10.1 Wi-Fi (P5110) |
136
137
h2. Troubleshooting
138
139
h3. Making sure that the device is connected in download mode
140 35 Denis 'GNUtoo' Carikli
141 34 Denis 'GNUtoo' Carikli
You can run the following command to verify if the device is in download mode:
142
<pre>
143 38 Denis 'GNUtoo' Carikli
lsusb
144 34 Denis 'GNUtoo' Carikli
</pre>
145
146
If it is you will then have one line that will be somewhat similar to that one:
147
<pre>
148
Bus 004 Device 002: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)
149
</pre>
150 36 Denis 'GNUtoo' Carikli
151 37 Denis 'GNUtoo' Carikli
h3. Heimdall failing with "ERROR: Protocol initialisation failed!"
152 36 Denis 'GNUtoo' Carikli
153
It is pretty easy to end up with heimdall failling like that:
154
<pre>
155
Heimdall v1.4.2
156
157
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
158
http://www.glassechidna.com.au/
159
160
This software is provided free of charge. Copying and redistribution is
161
encouraged.
162
163
If you appreciate this software and you would like to support future
164
development please consider donating:
165
http://www.glassechidna.com.au/donate/
166
167
Initialising connection...
168
Detecting device...
169
Claiming interface...
170
Setting up interface...
171
172
Initialising protocol...
173
ERROR: Protocol initialisation failed!
174
175
Releasing device interface...
176
</pre>
177
178
In that case disconnect and reconnect the USB cable from the computer and try again.