Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 69

Mark Matney, 08/01/2019 08:27 AM
fix broken links to sections on this page

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 68 Mark Matney
There are a few additional steps to follow, depending on which device you have.
70
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 67 Mark Matney
h2. Flash the recovery image
90 1 Denis 'GNUtoo' Carikli
91 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]].
92 1 Denis 'GNUtoo' Carikli
93 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]].
94 1 Denis 'GNUtoo' Carikli
95 67 Mark Matney
h3. Install the recovery image
96 1 Denis 'GNUtoo' Carikli
97
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.
98
99 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]].
100 1 Denis 'GNUtoo' Carikli
101 65 Mark Matney
Once in the recovery you can then proceed to the installation or s.
102 1 Denis 'GNUtoo' Carikli
103 65 Mark Matney
|_. Devices |_. Command for installing the recovery image |
104 1 Denis 'GNUtoo' Carikli
|_. Galaxy Nexus (I9250) |  <pre>heimdall flash --boot path/to/recovery-<yourdevice>.img --recovery path/to/recovery-<yourdevice>.img</pre> |
105
|_. Galaxy S 3 (I9300) |/5. <pre>heimdall flash --BOOT path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> |
106
|_. Galaxy S 3 4G (I9305) |
107
|_. Galaxy Note 2 (N7100) |
108
|_. Galaxy Note 8.0 (N5100) |
109
|_. Galaxy Note 8.0 Wi-Fi (N5110) |
110
|_. Galaxy S 2 (I9100) |/6. <pre>heimdall flash --KERNEL path/to/recovery-<yourdevice>.img --RECOVERY path/to/recovery-<yourdevice>.img</pre> |
111
|_. Galaxy Note (N7000) |
112
|_. Galaxy Tab 2 7.0 (P3100) |
113
|_. Galaxy Tab 2 7.0 Wi-Fi (P3110) |
114
|_. Galaxy Tab 2 10.1 (P5100) |
115
|_. Galaxy Tab 2 10.1 Wi-Fi (P5110) |
116 65 Mark Matney
117
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.
118
119
Otherwise, see the section on [[RecoveryInstallationWithHeimdall#Troubleshooting|troubleshooting]].
120
121 67 Mark Matney
h3. Upgrade the recovery image
122 65 Mark Matney
123
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.
124
125 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]].
126 65 Mark Matney
127
The command to update the recovery depends on which device you have. See below.
128
129
h4. Galaxy Nexus (I9250)
130
131
If your device is the Galaxy Nexus (I9250):
132
133
<pre>heimdall flash --recovery path/to/recovery-<yourdevice>.img</pre>
134
135
h4. All other devices
136
137
For all other devices:
138
139
 <pre>heimdall flash --RECOVERY path/to/recovery-<yourdevice>.img</pre>
140 34 Denis 'GNUtoo' Carikli
141
h2. Troubleshooting
142
143
h3. Making sure that the device is connected in download mode
144 35 Denis 'GNUtoo' Carikli
145 34 Denis 'GNUtoo' Carikli
You can run the following command to verify if the device is in download mode:
146
<pre>
147 38 Denis 'GNUtoo' Carikli
lsusb
148 34 Denis 'GNUtoo' Carikli
</pre>
149
150
If it is you will then have one line that will be somewhat similar to that one:
151
<pre>
152
Bus 004 Device 002: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)
153
</pre>
154 36 Denis 'GNUtoo' Carikli
155 37 Denis 'GNUtoo' Carikli
h3. Heimdall failing with "ERROR: Protocol initialisation failed!"
156 36 Denis 'GNUtoo' Carikli
157
It is pretty easy to end up with heimdall failling like that:
158
<pre>
159
Heimdall v1.4.2
160
161
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
162
http://www.glassechidna.com.au/
163
164
This software is provided free of charge. Copying and redistribution is
165
encouraged.
166
167
If you appreciate this software and you would like to support future
168
development please consider donating:
169
http://www.glassechidna.com.au/donate/
170
171
Initialising connection...
172
Detecting device...
173
Claiming interface...
174
Setting up interface...
175
176
Initialising protocol...
177
ERROR: Protocol initialisation failed!
178
179
Releasing device interface...
180
</pre>
181
182
In that case disconnect and reconnect the USB cable from the computer and try again.
183 54 Denis 'GNUtoo' Carikli
184
If it still fails, make sure that your computer isn't doing resource intensive tasks:
185
* Doing tasks that uses a lot your storage device (HDD, SSD, etc) can easily make the installation of the images fail.
186
187
If it still fails:
188
* Verify if your USB cable is not damaged by trying with another cable if you have one
189
* Verify if your USB port is not damaged by trying with another port if you have one