Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 73

Denis 'GNUtoo' Carikli, 02/14/2020 03:17 AM
Update image download section: fix device name, and use release specific recovery, and signing key

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
{{TOC}}
6 1 Denis 'GNUtoo' Carikli
7 59 Mark Matney
h2. Prerequisites
8
9
h3. Applicable devices
10
11 1 Denis 'GNUtoo' Carikli
This guide applies only to the following devices:
12 60 Mark Matney
* [[GalaxyS2I9100|Galaxy S 2 (I9100)]]
13
* [[GalaxyS3I9300|Galaxy S 3 (I9300)]]
14
* [[GalaxyS3I9305|Galaxy S 3 4G (I9305)]]
15
* [[GalaxyNexusI9250|Galaxy Nexus (I9250)]]
16
* [[GalaxyNoteN7000|Galaxy Note (N7000)]]
17
* [[GalaxyNote2N7100|Galaxy Note 2 (N7100)]]
18
* [[GalaxyTab270P31xx|Galaxy Tab 2 7.0 (P3100)]]
19
* [[GalaxyTab270P31xx|Galaxy Tab 2 7.0 Wi-Fi (P3110)]]
20
* [[GalaxyTab2101P51xx|Galaxy Tab 2 10.1 (P5100)]]
21
* [[GalaxyTab2101P51xx|Galaxy Tab 2 10.1 Wi-Fi (P5110)]]
22
* [[GalaxyNote80N51xx|Galaxy Note 8.0 (N5100)]]
23
* [[GalaxyNote80N51xx|Galaxy Note 8.0 Wi-Fi (N5110)]]
24 1 Denis 'GNUtoo' Carikli
25 66 Mark Matney
If you use these instructions with a device not listed above, there is a significant risk of ""bricking" your device":https://en.wikipedia.org/wiki/Brick_(electronics).
26 1 Denis 'GNUtoo' Carikli
27 59 Mark Matney
h3. Personal computer
28
29
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.
30
31
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.
32 1 Denis 'GNUtoo' Carikli
33 67 Mark Matney
h2. Install heimdall
34 63 Mark Matney
35 71 Denis 'GNUtoo' Carikli
The heimdall tool is required to flash (install) the recovery image to your device.
36
37 72 Denis 'GNUtoo' Carikli
If you don't already have heimdall you can use the instructions on the [[ToolsInstallation]] page to install all the required tools.
38 63 Mark Matney
39 67 Mark Matney
h2. Download the files
40 1 Denis 'GNUtoo' Carikli
41 73 Denis 'GNUtoo' Carikli
First find the section for the Replicant version you want to install. 
42 1 Denis 'GNUtoo' Carikli
43 73 Denis 'GNUtoo' Carikli
For instance if you want to install Replicant 6.0 0003, go in the [[Images#Replicant-60-0003-images|Replicant 6.0 0003 section]].
44
45
Then find the @Security@ subsection and download the GPG signing key for that release.
46
47
Then, you need to find the @Images@ subsection, and, inside it find the in the row that corresponds to your device.
48
49
Inside that row, there are links to the recovery image and the corresponding signature, which are in that row under the column *Bootable/recovery*.
50
51
You need to download both files to your PC.
52
53
For example, if you want to install Replicant to a [[GalaxyS2I9100|Galaxy S II (GT-I9100)]], you will download *recovery-i9100.img* and *recovery-i9100.img.asc*.
54 61 Mark Matney
55 67 Mark Matney
h2. Check the signature of the recovery image
56 1 Denis 'GNUtoo' Carikli
57 62 Mark Matney
First, [[ReplicantReleaseKey#Retrieving-the-Replicant-release-key|add the Replicant release key to your GPG keyring]].
58
59
Then, from the command line:
60
61
# Change directories to the location of the recovery image and its signature (the location of the files may differ depending on your system setup):
62 1 Denis 'GNUtoo' Carikli
<pre>
63
cd "${HOME}/Downloads/"
64 56 Mark Matney
</pre>
65 62 Mark Matney
# Check the signature of the recovery with the following command, substituting "<yourdevice>" with your device's identifier:
66 1 Denis 'GNUtoo' Carikli
<pre>
67
gpg --verify recovery-<yourdevice>.img.asc
68
</pre>
69
70
Unless GPG reports something to the effect of a "good signature" from [[ReplicantReleaseKey#Which-key-for-which-Replicant-version|the expected key]], *do not continue*! Your downloaded files may be corrupted or compromised.
71
72 67 Mark Matney
h2. Prepare the device
73 1 Denis 'GNUtoo' Carikli
74
The next step in the installation process is to prepare the device for heimdall mode.
75
76 56 Mark Matney
# Make sure the device is completely turned off and the USB cable is disconnected from the device
77
# Remove the device's "external case":https://en.wikipedia.org/wiki/Mobile_phone_accessories#Cases or protection if it has one.
78 1 Denis 'GNUtoo' Carikli
79 68 Mark Matney
There are a few additional steps to follow, depending on which device you have.
80
81 56 Mark Matney
h3. Galaxy Nexus (I9250)
82 1 Denis 'GNUtoo' Carikli
83 56 Mark Matney
If your device is the Galaxy Nexus (I9250):
84
85
# Start the device by holding the following key combination:  *Volume down, Power*.
86
# Hold the key combination until the device shows a green "Start".
87
88
h3. All other devices
89
90
For all other devices:
91
92
# Start the device by holding the following key combination: *Volume down, Select, Power*,
93
# Hold the key combination until the device shows a *Warning* message.
94
# Confirm that you want to download a custom OS using volume up
95
# Make sure the device is in *Downloading* mode
96 33 Denis 'GNUtoo' Carikli
97 39 Denis 'GNUtoo' Carikli
You can then connect the USB cable to both the computer and the device
98
99 67 Mark Matney
h2. Flash the recovery image
100 1 Denis 'GNUtoo' Carikli
101 69 Mark Matney
For instructions on installing the recovery image on your device for the first time, proceed to the section on [[RecoveryInstallationWithHeimdall#Install-the-recovery-image|installing the recovery]].
102 1 Denis 'GNUtoo' Carikli
103 69 Mark Matney
Otherwise, for instructions on updating the recovery image on your device, proceed to the section on [[RecoveryInstallationWithHeimdall#Upgrade-the-recovery-image|upgrading the recovery]].
104 1 Denis 'GNUtoo' Carikli
105 67 Mark Matney
h3. Install the recovery image
106 1 Denis 'GNUtoo' Carikli
107
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.
108
109 69 Mark Matney
If instead you only want to upgrade an existing recovery, use the commands in the section on [[RecoveryInstallationWithHeimdall#Upgrade-the-recovery-image|upgrading the recovery]].
110 1 Denis 'GNUtoo' Carikli
111 65 Mark Matney
Once in the recovery you can then proceed to the installation or s.
112 1 Denis 'GNUtoo' Carikli
113 65 Mark Matney
|_. Devices |_. Command for installing the recovery image |
114 1 Denis 'GNUtoo' Carikli
|_. Galaxy Nexus (I9250) |  <pre>heimdall flash --boot path/to/recovery-<yourdevice>.img --recovery path/to/recovery-<yourdevice>.img</pre> |
115
|_. Galaxy S 3 (I9300) |/5. <pre>heimdall flash --BOOT path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> |
116
|_. Galaxy S 3 4G (I9305) |
117
|_. Galaxy Note 2 (N7100) |
118
|_. Galaxy Note 8.0 (N5100) |
119
|_. Galaxy Note 8.0 Wi-Fi (N5110) |
120
|_. Galaxy S 2 (I9100) |/6. <pre>heimdall flash --KERNEL path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> |
121
|_. Galaxy Note (N7000) |
122
|_. Galaxy Tab 2 7.0 (P3100) |
123
|_. Galaxy Tab 2 7.0 Wi-Fi (P3110) |
124
|_. Galaxy Tab 2 10.1 (P5100) |
125
|_. Galaxy Tab 2 10.1 Wi-Fi (P5110) |
126 65 Mark Matney
127
If your device reboots into the recovery OS, *you have successfully installed the Replicant recovery*. Proceed with the remaining [[ReplicantInstallation|installation instructions]], or with the [[MinorVersionUpgrade|minor version upgrade instructions]] if you are upgrading an existing Replicant installation.
128
129
Otherwise, see the section on [[RecoveryInstallationWithHeimdall#Troubleshooting|troubleshooting]].
130
131 67 Mark Matney
h3. Upgrade the recovery image
132 65 Mark Matney
133
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.
134
135 69 Mark Matney
If instead you are installing Replicant for the first time, use the commands in the section on [[RecoveryInstallationWithHeimdall#Install-the-recovery-image|installing the recovery]].
136 65 Mark Matney
137
The command to update the recovery depends on which device you have. See below.
138
139
h4. Galaxy Nexus (I9250)
140
141
If your device is the Galaxy Nexus (I9250):
142
143
<pre>heimdall flash --recovery path/to/recovery-<yourdevice>.img</pre>
144
145
h4. All other devices
146
147
For all other devices:
148
149
 <pre>heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img</pre>
150 34 Denis 'GNUtoo' Carikli
151
h2. Troubleshooting
152
153
h3. Making sure that the device is connected in download mode
154 35 Denis 'GNUtoo' Carikli
155 34 Denis 'GNUtoo' Carikli
You can run the following command to verify if the device is in download mode:
156
<pre>
157 38 Denis 'GNUtoo' Carikli
lsusb
158 34 Denis 'GNUtoo' Carikli
</pre>
159
160
If it is you will then have one line that will be somewhat similar to that one:
161
<pre>
162
Bus 004 Device 002: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)
163
</pre>
164 36 Denis 'GNUtoo' Carikli
165 37 Denis 'GNUtoo' Carikli
h3. Heimdall failing with "ERROR: Protocol initialisation failed!"
166 36 Denis 'GNUtoo' Carikli
167
It is pretty easy to end up with heimdall failling like that:
168
<pre>
169
Heimdall v1.4.2
170
171
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
172
http://www.glassechidna.com.au/
173
174
This software is provided free of charge. Copying and redistribution is
175
encouraged.
176
177
If you appreciate this software and you would like to support future
178
development please consider donating:
179
http://www.glassechidna.com.au/donate/
180
181
Initialising connection...
182
Detecting device...
183
Claiming interface...
184
Setting up interface...
185
186
Initialising protocol...
187
ERROR: Protocol initialisation failed!
188
189
Releasing device interface...
190
</pre>
191
192
In that case disconnect and reconnect the USB cable from the computer and try again.
193 54 Denis 'GNUtoo' Carikli
194
If it still fails, make sure that your computer isn't doing resource intensive tasks:
195
* Doing tasks that uses a lot your storage device (HDD, SSD, etc) can easily make the installation of the images fail.
196
197
If it still fails:
198
* Verify if your USB cable is not damaged by trying with another cable if you have one
199
* Verify if your USB port is not damaged by trying with another port if you have one