How to flash a Generic System Image (GSI) on FP3
The Generic System Image is an efficient way to have a custom ROM on the new phones. It works thanks to the Project Treble. It makes possible to flash a generic image on the system keeping the hardware relative part intact. (Which also leaves some unwanted app)
Disclaimer
I am not responsible of anything you do with your device. Some wrong actions can brick your phone.
Requirements
- Unlocked bootloader (this will wipe all your data: ✏ FP3: unlock the bootloader ;
- Download the GSI of your choice. arch: arm64, A/B slot (usually arm64_bvN images) here is a list ;
- Download GSI hardware overlay for FP3
- Download TWRP for FP3 ;
- [Optional] Download magisk ;
- Keep your device battery charged up to 70% at least ;
- Slot a and b have to be in
success
state :
To verify, boot in bootloader and typefastboot getvar all
, you should see :
[...]
(bootloader) slot-success:b:Yes
[...]
(bootloader) slot-success:a:Yes
[...]
If not, go to the Troubleshooting Tips part.
Flash GSI
Optional : Root
- [Optional] If you want to install TWRP, do it by following k4y0z instructions
- Boot into TWRP :
If TWRP is installed, boot into recovery else boot in bootloader and execute:fastboot boot {twrp_image.img}
; - Install magisk from TWRP :
2.a Select the Install button.
2.b Find the folder where you download the zip file.
2.c Select the zip file
2.d Swipe the slider to install Magisk
Install the GSI
- Boot to bootloader
- Flash GSI on the system partition
fastboot flash system {gsi_image.img}
- Boot into TWRP :
If TWRP is installed, boot into recovery else boot in bootloader and execute:fastboot boot {twrp_image.img}
; - Mount
/system
writable
adb shell mount /system_root
- Install the overlay
adb push treble-overlay-fairphone-fp3.apk /system/overlay/
- Disable verity
adb disable-verity
- Reboot to bootloader
- Erase userdata, reboot and wait
fastboot -w
fastboot reboot
Note: the APK Magisk Manager may not work with some GSI.
Flash back stock ROM
If you can boot in TWRP :
- Make sure you have the latest version of TWRP ;
- If TWRP is installed, boot into recovery else boot in bootloader and execute:
fastboot boot {twrp_image.img}
; - Make sure you have the option “Mount system partition read-only” checked (in mount) ;
- Install the latest flashable ZIP.
If you can’t boot in TWRP :
You can use this script : fp3_flash_stock.
You should probably run it twice to flash both slots.
If you get the 30 seconds warning after that, dont forget to confirm booting with pressing the power button. After booting continue with "get rid of the “30seconds Warning”
Do vendor update
System updates depend on the GSI maintainer, but the others still depends on fairphone.
Please, consider to do a backup of your data first.
- Flash latest stock ROM (cf Flash back stock ROM)
- Install again the GSI, without erasing userdata (Install GSI step 1 → 6)
Example :
% adb reboot bootloader
% sudo ./flash.sh
% sudo fastboot flash system system_gsi.img
% sudo fastboot boot twrp-3.3.1-0_k4y0z-20200202-02-fp3.img
% adb shell mount /system_root
% adb push treble-overlay-fairphone-fp3.apk /system/overlay/
% adb disable-verity
% adb reboot
Note : If reboot boot to recovery, press power + Vol UP and select boot system
.
Here is a little termux app to get notified when a new vendor update is available. It is based on the support page .
Troubleshooting Tips
To get a slot-success=Yes
You need to have the stock rom and do :
fastboot --set-active=a
fastboot reboot # until it completely boot
fastboot --set-active=b
fastboot reboot # until it completely boot
To get back the navigation bar
Use Magisk module MagiskHidePropsConf and set prop qemu.hw.mainkeys
to 0.
- install Busybox for Android NDK by searching for it in the “Downloads” section of Magisk manager
- install MagiskHidePropsConf by searching for it in the “Downloads” section of Magisk manager
- otherwise one gets an error message from the
props
command that comes with MagiskHidePropsConf - reboot
- otherwise one gets an error message from the
-
adb shell
and thenprops
following the menu to “Add/edit custom props > New custom prop” to create theqemu.hw.mainkeys
property and then setting it to “0”- reboot
To disable some useless priv apps
adb shell pm disable-user --user 0 com.qualcomm.qti.qms.service.telemetry
adb shell pm disable-user --user 0 com.qualcomm.qti.qms.service.connectionsecurity
adb shell pm disable-user --user 0 com.qualcomm.qti.qms.service.trustzoneaccess
adb shell pm disable-user --user 0 com.qualcomm.qti.optinoverlay
adb shell pm disable-user --user 0 com.orange.update
adb shell pm disable-user --user 0 com.orange.aura.oobe
You can use adb shell pm uninstall -k
instead of adb shell pm disable-user
if you experience any re-activation, but you won’t be able to reactivate it without a computer.
To get rid of the “30 seconds Warning” at boot
If you see the warning that shuts down the phone after the 30 seconds :
adb reboot "dm-verity enforcing"
Thanks
Thanks to @k4y0z, @dyd0u, @basxto, @z3ntu, @corvuscorax, @michlx, @Claymore1297, @Ingo
And thanks to all the dev teams and the community for that awesome work
(pm if you’d like to be here and I forgot you )
Other
Let us know if you tried with an other GSI!
Tested with
[AOSP 9 based]
AOSP 9 (Official, maintained)
ArrowOS (Official, not actively maintained)
BlissOS (Official, not maintained)
LineageOS 16 (Unofficial, not maintained)
Resurrection Remix (Official, not maintained) ~
HavocOS (Official, not maintained)
[AOSP 10 based, still in deep development]
AOSP 10 (Official, maintained)
/e/ custom build (unofficial, maintained)
LineageOS 17.1 or LineageOS 17.1 with OTA (Unofficial, maintained)
[Android 11 Developer Preview]
android-gsi-11 (official, maintained) (bootloop)
Official/unofficial information come from this gsi list. Please refer to the GSI maintainer if the ROM doesn’t work.