-
Notifications
You must be signed in to change notification settings - Fork 76
/
FP4.yml
255 lines (254 loc) · 8.82 KB
/
FP4.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: "Fairphone 4"
codename: "FP4"
formfactor: "phone"
aliases: ["fp4"]
doppelgangers: []
user_actions:
confirm_model:
title: "Confirm your model"
description: "Please check that your device is a Fairphone 4 (FP4)."
confirm_os:
title: "Confirm OS version"
description: "Your device must be running the Fairphone OS version of Android 11 before installing another operating system. With a previously installed custom ROM, it won't work!"
link: "https://support.fairphone.com/hc/en-us/articles/18896094650513-Installing-Fairphone-OS-Manually"
unlock_phone:
title: "Unlock the bootloader"
description: "Before installing another operating system you must unlock the bootloader of your phone manually. Follow the steps in the linked page if you haven't already."
link: "https://support.fairphone.com/hc/en-us/articles/10492476238865-Manage-the-Bootloader"
bootloader:
title: "Reboot to Bootloader"
description: "With the device powered off, press and hold the VOLUME DOWN button and plug the device into your PC via USB. After some seconds you'll see the fastboot mode."
image: "phone_power_down"
button: true
bootloader_from_fastbootd:
title: "Reboot to Bootloader"
description: 'With the device still at the fastbootd screen, use the volume buttons to select "Reboot to bootloader".'
image: "phone_power_down"
button: true
recovery:
title: "Reboot to Recovery"
description: 'With the device still at the "FastBoot Mode", use the Volume buttons to switch to "Recovery Mode" and push the power button to confirm your selection.'
image: "phone_power_up"
button: true
fastbootd:
title: "Reboot to fastbootd mode"
description: 'With the device still at the "FastBoot Mode", use the Volume buttons to switch to "Recovery Mode" and push the power button to confirm your selection. Then select "Fastboot mode" from the list.'
image: "phone_power_up"
button: true
unlock:
- "confirm_model"
- "confirm_os"
- "unlock_phone"
operating_systems:
- name: "Ubuntu Touch"
compatible_installer: ">=0.9.6-beta"
options:
- var: "channel"
name: "Channel"
tooltip: "The release channel"
link: "https://docs.ubports.com/en/latest/about/process/release-schedule.html"
type: "select"
remote_values:
systemimage:channels:
- var: "wipe"
name: "Wipe Userdata"
tooltip: "Wipe personal data. This is necessary for first time installations."
type: "checkbox"
- var: "partition"
name: "Partitioning"
tooltip: "Changes partition sizes as required. Only necessary for first time installations."
type: "checkbox"
value: true
- var: "bootstrap"
name: "Bootstrap"
tooltip: "Flash system partitions using fastboot"
type: "checkbox"
value: true
prerequisites: []
steps:
### Ensure we always start in bootloader mode
- actions:
- adb:reboot:
to_state: "bootloader"
fallback:
- core:user_action:
action: "bootloader"
### Ensure the bootloader has been unlocked already
- actions:
- fastboot:wait:
- actions:
- fastboot:assert_var:
variable: "unlocked"
value: "yes"
fallback:
- core:user_action:
action: "unlock_phone"
### As this is an A/B device, force all future operations in "a" slot.
- actions:
- fastboot:set_active:
slot: "a"
### Flash important partitions (if requested)
- actions:
- core:download:
group: "firmware"
files:
- url: "https://cdimage.ubports.com/devices/FP4/boot.img"
checksum:
sum: "c1ab7a12e48edddc089cd93265e475ff58242919427520a589fc19203c8fb628"
algorithm: "sha256"
- url: "https://cdimage.ubports.com/devices/FP4/dtbo.img"
checksum:
sum: "68ad83e20eb2b47592c2b7fe48161893770b1727c7b7ce7240504eaf8612d733"
algorithm: "sha256"
- url: "https://cdimage.ubports.com/devices/FP4/recovery.img"
checksum:
sum: "f5b867a95295de34a77294160282c52fe1cd4d3847535f32c0be4a466bc55432"
algorithm: "sha256"
condition:
var: "bootstrap"
value: true
- actions:
- fastboot:flash:
partitions:
- partition: "boot"
file: "boot.img"
group: "firmware"
raw: true
- partition: "dtbo"
file: "dtbo.img"
group: "firmware"
raw: true
- partition: "recovery"
file: "recovery.img"
group: "firmware"
raw: true
condition:
var: "bootstrap"
value: true
### Set up logical partitions (if requested)
- actions:
- fastboot:reboot_fastboot:
fallback:
- core:user_action:
action: "fastbootd"
condition:
var: "partition"
value: true
- actions:
# Remove all unused logical partitions
- fastboot:delete_logical_partition:
partition: "system_ext_a"
- fastboot:delete_logical_partition:
partition: "system_ext_b"
- fastboot:delete_logical_partition:
partition: "product_a"
- fastboot:delete_logical_partition:
partition: "product_b"
# Remove _b variants of used partitions
- fastboot:delete_logical_partition:
partition: "system_b"
- fastboot:delete_logical_partition:
partition: "vendor_b"
- fastboot:delete_logical_partition:
partition: "odm_b"
# Increase space for system_a for UT installation
- fastboot:resize_logical_partition:
partition: "system_a"
size: 3221225472
condition:
var: "partition"
value: true
- actions:
- fastboot:reboot_bootloader:
fallback:
- core:user_action:
action: "bootloader_from_fastbootd"
condition:
var: "partition"
value: true
### Wipe userdata (if requested)
- actions:
- fastboot:erase:
partition: "userdata"
condition:
var: "wipe"
value: true
- actions:
- fastboot:format:
partition: "userdata"
type: "ext4"
condition:
var: "wipe"
value: true
### Systemimage installation steps
- actions:
- fastboot:reboot_recovery:
fallback:
- core:user_action:
action: "recovery"
- actions:
- systemimage:install:
verify_recovery: true
- actions:
- adb:reboot:
to_state: "recovery"
fallback:
- core:user_action:
action: "recovery"
slideshow: []
- name: "postmarketOS"
codename: "fairphone-fp4"
compatible_installer: ">=0.9.8-beta"
options:
- var: "release"
name: "Release"
tooltip: "The postmarketOS release"
link: "https://wiki.postmarketos.org/wiki/Releases"
type: "select"
remote_values:
postmarketos:releases:
- var: "interface"
name: "User Interface"
tooltip: "The user interface"
link: "https://wiki.postmarketos.org/wiki/Category:Interface"
type: "select"
remote_values:
postmarketos:interfaces:
prerequisites: []
steps:
### Ensure we always start in bootloader mode
- actions:
- adb:reboot:
to_state: "bootloader"
fallback:
- core:user_action:
action: "bootloader"
### Ensure the bootloader has been unlocked already
- actions:
- fastboot:wait:
- actions:
- fastboot:assert_var:
variable: "unlocked"
value: "yes"
fallback:
- core:user_action:
action: "unlock_phone"
### As this is an A/B device, force all future operations in "a" slot.
- actions:
- fastboot:set_active:
slot: "a"
### Flash partitions
- actions:
- postmarketos:download:
- fastboot:erase:
partition: "dtbo"
- fastboot:flash:
partitions:
- partition: "userdata"
file: "rootfs.img"
group: "postmarketOS"
- partition: "boot"
file: "boot.img"
group: "postmarketOS"
- fastboot:continue:
slideshow: []