Project

General

Profile

RecoveryInstallationWithHeimdall » History » Version 63

Mark Matney, 07/28/2019 07:32 AM
move section on installing heimdall to the top, since it's a good sanity check that they have the proper PC setup

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