Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 67

Mark Matney, 07/28/2019 08:15 AM
make all section titles in the imperative tone

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