English

[HOW TO] Flash a custom ROM on FP3 with GSI

Yep I don’t understand it too, everything works before (back to stock, switching GSIs).

Tried the steps you provided and bootloader works on both slots

Thanks for helping out!

Ok, nice.
fastboot boot {twrp} doesn’t work on both slots?

If you manage to boot in TWRP, you’ll probably be able to do a data backup :wink:

Edit : If it works on a slot and not on the other, flash the not working one first (Reboot > slot in TWRP)

No dont boot :confused:

First time i get the Error FAILED (Status read failed (Protocol error))
And then I get unknown reason on both slots

Do you have the stock ROM images somewhere ?

You mean the downloaded zip?

OK download the full stock 0105 dump :
TWRP for Fairphone 3 (remove dsp.img)
And the non-corrupted dsp : https://forum.fairphone.com/uploads/short-url/tajRvRzKZ3dWL8zwk9BMFfhXOVU.pdf (rename it dsp.zip and unzip it)

Then do :

fastboot --set-active=a
fastboot reboot bootloader
fastboot getvar current-slot 2>&1 | grep "current-slot: a" >/dev/null || exit 2
fastboot flash product product.img -S 522239K || exit 1
fastboot flash keymaster keymaster.img -S 522239K || exit 1
fastboot flash cmnlib64 cmnlib64.img -S 522239K || exit 1
fastboot flash cmnlib cmnlib.img -S 522239K || exit 1
fastboot flash lksecapp lksecapp.img -S 522239K || exit 1
fastboot flash mdtp mdtp.img -S 522239K || exit 1
fastboot flash vendor vendor.img -S 522239K || exit 1
fastboot flash system system.img -S 522239K || exit 1
fastboot flash boot boot.img -S 522239K || exit 1
fastboot flash vbmeta vbmeta.img -S 522239K || exit 1
fastboot flash dtbo dtbo.img -S 522239K || exit 1
fastboot flash dsp dsp.img -S 522239K || exit 1
fastboot flash devcfg devcfg.img -S 522239K || exit 1
fastboot flash tz tz.img -S 522239K || exit 1
fastboot flash rpm rpm.img -S 522239K || exit 1
fastboot flash sbl1 sbl1.img -S 522239K || exit 1
fastboot flash modem modem.img -S 522239K || exit 1
fastboot flash aboot aboot.img -S 522239K || exit 1
fastboot reboot bootloader
fastboot getvar current-slot 2>&1 | grep "current-slot: a"  || exit 2
echo "Ok worked."

You absolutely need to see current-slot:a (and “Ok worked” if you do it in a script). If not, do :

fastboot flash product_a product.img -S 522239K || exit 1
fastboot flash keymaster_a keymaster.img -S 522239K || exit 1
fastboot flash cmnlib64_a cmnlib64.img -S 522239K || exit 1
fastboot flash cmnlib_a cmnlib.img -S 522239K || exit 1
fastboot flash lksecapp_a lksecapp.img -S 522239K || exit 1
fastboot flash mdtp_a mdtp.img -S 522239K || exit 1
fastboot flash vendor_a vendor.img -S 522239K || exit 1
fastboot flash system_a system.img -S 522239K || exit 1
fastboot flash boot_a boot.img -S 522239K || exit 1
fastboot flash vbmeta_a vbmeta.img -S 522239K || exit 1
fastboot flash dtbo_a dtbo.img -S 522239K || exit 1
fastboot flash dsp_a dsp.img -S 522239K || exit 1
fastboot flash devcfg_a devcfg.img -S 522239K || exit 1
fastboot flash tz_a tz.img -S 522239K || exit 1
fastboot flash rpm_a rpm.img -S 522239K || exit 1
fastboot flash sbl1_a sbl1.img -S 522239K || exit 1
fastboot flash modem_a modem.img -S 522239K || exit 1
fastboot flash aboot_a aboot.img -S 522239K || exit 1
fastboot reboot bootloader
fastboot getvar current-slot 2>&1 | grep "current-slot: a"  || exit 2
echo "Ok worked."

If still not, please tell before doing anything

If the first one worked, change --set-active=a to --set-active=b and the two grep "current-slot: a" to grep "current-slot: b"

Then you’ll have stock 0105 on both slots and you’ll be able to boot TWRP

2 Likes

Thank you, its booting :blush:
Thank you very much!!

1 Like

Just wanted to say thank you to everyone involved for making android available without google on fairphone 3, cheers!

I also wanted to report that AOSP 10 (specifically https://github.com/phhusson/treble_experimentations/releases/tag/v209) does not seem to work. It installs and boots fine, but as soon as you try to open an application, the device just reboots.

Lastly, a friendly tip (that perhaps should be included in the howto?), fastboot cannot flash archived images. I tried a few too many times to directly flash the .xz archive. Fastboot doesn’t give you any errors when doing so, but you first have to unarchive the file so what you flash is the actual uncompressed image. Rookie mistake I suppose :sweat_smile:

Welcome to the community forum.

It’s a Wiki post so that everybody can contribute and edit it directly :wink: .

1 Like

Did you try the g**gle gsi without the Gapps?
https://developer.android.com/topic/generic-system-image/releases

Oh, didn’t know that was a thing. I tried it now, but the issue is the same. It boots but as soon as I try to launch an application it reboots.

1 Like

Had the same experience. LOS17 does not respond to touch (not even unlocking), AOSP10 reboots as soon as i went into settings

2 Likes

I’ve added .img to all images in the wiki to avoid this mistake :slight_smile:

2 Likes

@rizzly

2 Likes

Right, so still under pretty heavy development! I took the liberty of adding AOSP 10 as not-working in the list above. Feel free to change that if you don’t really think it fits the list somehow (due to still being in development or so on).

Can confim it, there is an error in the graphics stack. I will look into it in the evening.
Have build my own Android 10 GSI with userdebug target.
If someone will look also into it, I can upload it.

1 Like

How is your own built going?

Actually I’m trying to figure out the technical difference between the activity calls.
Launch an activity from the launcher -> crash
Launch an activity at boot (Start the launcher) -> worked
Launch an activity from system-ui (settings in the noification menu) -> worked
Launch an activity inside settings app (for example wlan settings) -> crash

Where is the difference in the call to the graphics stack. The crash is in the presentDisplay method of the graphics composer (v2.1) and the error is an invalid argument.

There were changes in Android 10 in the method to show content on the display, see https://source.android.com/devices/graphics/implement-hwc

But actually I don’t get an concrete breaking point.

1 Like

Did you look into Andy yan and PHH’s tricks ?

Thanks for your efforts guys.
I followed the instructions carefully but so far had no success with flashing LOS with GSI. Both slots were “successful”, TWRP & Magisk is installed, flashing works without issues, fastboot -w was done, but the flashed slot never went beyond the Fairphone logo before it reboots…
I tried lineage-16.0-20191017-UNOFFICIAL-treble_arm64_bvN.img and lineage-17.1-20200111-UNOFFICIAL-treble_arm64_bvN.img by Andy Yan.

Any ideas? I now made a few attempts, always flashed back k4y0z’s dump files manually and I don’t think things will change with just repeating the same thing :slight_smile: Why can it actually work with other people’s identical FP3? :-/