Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 61

Mark Matney, 07/28/2019 07:13 AM
improve wording of instructions to download the files

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