TWRP installable stock firmware packages for Fairphone 3

how did you get the 110 update?

i only get 105 ota and then nothing

Nevermind i have made it!

flashed the 0110 with twrp to slot b, kicked it back in fastboot
flashed the vbmeta.img and sbl1.img to slot b from the 0110.

reboot

sucesess!!!

1 Like

Indeed. I’m sorry I’m new to this environment and toolchains. I’ll fix the error above.

1 Like

New TWRP release is up.
This one finally fixes installing the full stock ZIPs.
Make sure you have the option “Mount system partition read-only” checked in TWRP if you want to be able to OTA.

Thanks to @pigpig for testing!

8 Likes

I am preparing a stock image for version 8901.2.A.0096.20191001 (September 2019, v. A.0096). I am following k4y0z instructions:

Right now I have generated sparse images and corresponding dat-files for the system partition (nothing is produced by img2sdat for the other partitions). The truth is that I don’t even understand what are and why dat-files are required, it was my impression that sparse images alone were enough…

So of course I could also mimic k4y0z’s images for META-INF/com/google/android/updater-script, but I don’t know what to put in META-INF/com/android/metadata. Some fields are obvious, but what should be written exactly in post-build and post-build-incremental? I assume the other fields can be taken to be the same as in the other images.

I suspect on the one hand that all this is intended for diff-images, but on the other hand my understanding was that k4y0z was publishing full stock images… the image I am preparing comes from the initial ROM of my FP3, that was even pre-ordered before it was on ther market, so it will probably be the eldest ROM available, and therefore a full stock image (not a patch).

Could someone clarify these missing elements so that I can finalize this image?

I’m not sure if it really is required to make your dump into a TWRP-installable version.
It will likely mostly be used by developers and researchers and to use @corvuscorax payload_dumper to generate the intermediate versions using the official OTAs.
So it would likely suffice if you just upload the dump, as I have done initially for the 105 Firmware.
As for your other questions:
To create the dat files for product and vendor you have to pass the -p or --prefix option to img2sdat so it doesn’t overwrite the system images.
The conversion is mostly done for compressing the large filesystem-images (and possibly for error-correction) and this is the way ROM-Zips typically do it.
The info in metadata is from the /system/build.prop file (If you decide to mount the image, make sure you mount ro or use a copy, as for not to modify the original image):

post-timestamp = ro.build.date.utc
post-build-incremental = ro.build.version.incremental
post-build = ro.build.fingerprint
post-security-patch-level = ro.build.version.security_patch

Okay, I get it now, that is specifically useful for TWRP. Well, nothing is lost in doing it, then it is quicker to flash, and it can still be flashed manually file by file through fastboot.

Perfect, that was a silly mistake. What about the dsp partition? It is an ext4, but in your images you did not create corresponding dat-files and brotli-files I think.

You’d have to convert the product, vendor and system images again for flashing with fastboot, but yes that’s possible.

I did that initially, but given the size of it and the fact that it is mostly treated as an image like the modem partition I didn’t do that in the recent versions.
Also if you look at the output of the file command it would actually tell you, that system, vendor and product are ext2 while dsp is identified as ext4.

@k4y0z: I just saw in your images that you also flash a partition sbltest. Well, I don’t find such a partition on my device, what is that supposed to be? Everything else looks fine.

That’s a mistake on my side, you can safely remove that line.

Here is a stock image of the firmware that was on my phone when I bought it (probably the oldest firmware available):

Fairphone_FP3_8901.2.A.0096.20191001_10011803_user_release-keys.zip
(8779a165ce39ed8be2ded7f69f0a9d6e)

The phone has been unlocked before the firmware was extracted. This is also not a TWRP package, but there is a script of my own to install it using fastboot.

Feel free to pin the link at the beginning if you find it suitable.

2 Likes

So, as a follow-up …

… now the A.0111 update is available, and my updater doesn’t update and complains about the system partition.

03-19 21:17:50.814   784   784 I update_engine: [0319/211750.814552:INFO:delta_performer.cc(374)] Opening /dev/block/bootdevice/by-name/system_a partition without O_DSYNC
03-19 21:17:50.815   784   784 I update_engine: [0319/211750.815629:INFO:delta_performer.cc(126)] Caching writes.
03-19 21:17:50.815   784   784 I update_engine: [0319/211750.815794:INFO:delta_performer.cc(386)] Applying 6620 operations to partition "system"
03-19 21:17:50.852   784   784 E update_engine: [0319/211750.852800:ERROR:delta_performer.cc(990)] The hash of the source data on disk for this operation doesn't match the expected value. This could mean that the delta update payload was targeted for another version, or that the source partition was modified after it was installed, for example, by mounting a filesystem.
03-19 21:17:50.853   784   784 E update_engine: [0319/211750.853026:ERROR:delta_performer.cc(995)] Expected:   sha256|hex = 4624201CA589D350FB5CACFEFBB1B585CA128D42E0B2FEF8B5F0A17145C697C9
03-19 21:17:50.853   784   784 E update_engine: [0319/211750.853072:ERROR:delta_performer.cc(998)] Calculated: sha256|hex = FECA0CB7131E7B81E91B4DF33C3C3AB1494B446B051DEA8247564F3C0998716A
03-19 21:17:50.853   784   784 E update_engine: [0319/211750.853167:ERROR:delta_performer.cc(1009)] Operation source (offset:size) in blocks: 0:2,191:16,222:295,8289:2,8303:2,8352:1,8371:1,8383:1,8424:1,8484:1,8488:1,8523:1,8554:1,8559:1,8563:1,8576:1,8601:1,8633:1,8637:1,8658:1,8666:1,8670:1,8682:1,8690:1,8717:1,8724:1,8736:1,8775:1,8779:1,8785:1,24002:8,24362:5,28648:1,32593:1,32768:2,33229:8,38050:20,38116:1,38488:2,38930:1,39799:1,42717:1,46743:1,47109:3,51082:8,54916:31,54948:1,54950:34,54987:6,54996:3,55001:18,55020:1,55022:13
03-19 21:17:50.853   784   784 W update_engine: [0319/211750.853282:WARNING:mount_history.cc(66)] Device was remounted R/W 3 times. Last remount happened on 1970-01-02 19:30:47.000 UTC.
03-19 21:17:50.853   784   784 E update_engine: [0319/211750.853335:ERROR:delta_performer.cc(1191)] ValidateSourceHash(source_hash, operation, source_fd_, error) failed.
03-19 21:17:50.853   784   784 E update_engine: [0319/211750.853378:ERROR:delta_performer.cc(298)] Failed to perform BROTLI_BSDIFF operation 1399, which is the operation 0 in partition "system"
03-19 21:17:50.853   784   784 E update_engine: [0319/211750.853420:ERROR:download_action.cc(337)] Error ErrorCode::kDownloadStateInitializationError (20) in DeltaPerformer's Write method when processing the received payload -- Terminating processing

I installed the A.0110 stock package (linked to in the first post) just now with TWRP, which went fine, but the updater still complains about system.

03-19 22:14:15.499   733   733 I update_engine: [0319/221415.499761:INFO:delta_performer.cc(374)] Opening /dev/block/bootdevice/by-name/system_a partition without O_DSYNC
03-19 22:14:15.501   733   733 I update_engine: [0319/221415.501070:INFO:delta_performer.cc(126)] Caching writes.
03-19 22:14:15.501   733   733 I update_engine: [0319/221415.501372:INFO:delta_performer.cc(386)] Applying 6620 operations to partition "system"
03-19 22:14:15.554   733   733 E update_engine: [0319/221415.554832:ERROR:delta_performer.cc(990)] The hash of the source data on disk for this operation doesn't match the expected value. This could mean that the delta update payload was targeted for another version, or that the source partition was modified after it was installed, for example, by mounting a filesystem.
03-19 22:14:15.555   733   733 E update_engine: [0319/221415.555040:ERROR:delta_performer.cc(995)] Expected:   sha256|hex = 4624201CA589D350FB5CACFEFBB1B585CA128D42E0B2FEF8B5F0A17145C697C9
03-19 22:14:15.555   733   733 E update_engine: [0319/221415.555091:ERROR:delta_performer.cc(998)] Calculated: sha256|hex = 39E9EF4ADFEC1EAA9E797858F764A65B8150016B3CFCC4D9BD31F2FE97985616
03-19 22:14:15.555   733   733 E update_engine: [0319/221415.555186:ERROR:delta_performer.cc(1009)] Operation source (offset:size) in blocks: 0:2,191:16,222:295,8289:2,8303:2,8352:1,8371:1,8383:1,8424:1,8484:1,8488:1,8523:1,8554:1,8559:1,8563:1,8576:1,8601:1,8633:1,8637:1,8658:1,8666:1,8670:1,8682:1,8690:1,8717:1,8724:1,8736:1,8775:1,8779:1,8785:1,24002:8,24362:5,28648:1,32593:1,32768:2,33229:8,38050:20,38116:1,38488:2,38930:1,39799:1,42717:1,46743:1,47109:3,51082:8,54916:31,54948:1,54950:34,54987:6,54996:3,55001:18,55020:1,55022:13
03-19 22:14:15.555   733   733 W update_engine: [0319/221415.555305:WARNING:mount_history.cc(66)] Device was remounted R/W 2 times. Last remount happened on 1970-01-08 00:53:56.000 UTC.
03-19 22:14:15.555   733   733 E update_engine: [0319/221415.555359:ERROR:delta_performer.cc(1191)] ValidateSourceHash(source_hash, operation, source_fd_, error) failed.
03-19 22:14:15.555   733   733 E update_engine: [0319/221415.555404:ERROR:delta_performer.cc(298)] Failed to perform BROTLI_BSDIFF operation 1399, which is the operation 0 in partition "system"
03-19 22:14:15.555   733   733 E update_engine: [0319/221415.555445:ERROR:download_action.cc(337)] Error ErrorCode::kDownloadStateInitializationError (20) in DeltaPerformer's Write method when processing the received payload -- Terminating processing

I have no idea where these “Device was remounted R/W” warnings are coming from.
I only used the latest TWRP for backups, and by default it doesn’t show system as mounted.

Any idea how to proceed?

1 Like

Have you made sure the “Mount system partition read-only” is checked before you installed 110?

1 Like

I don’t get that request anymore when TWRP starts up.
I guess I would have to delete the .twrps file?

But what can be done about system then?

Just go to the Mount page, there is a checkbox at the bottom:

2 Likes

Nice … some more dots I didn’t connect until now.
Thank you very much, the update ran successfully now.

3 Likes

A post was merged into an existing topic: TWRP for Fairphone 3

Hmm… How can I make a full backup from my current FP3 firmware? Click “Backup” on TWRP? My FP3 is never used, one time started.

I want to install /e/ alpha on weekend. :smiley:

Same issue than AnotherElk, but with latest version of TWRP.

I was not able to install the new OTA update, so I tried to flash with TWRP the 110. I already had the mount system read only checked.

But after successful install, the phone does not boot. I end up with a screen saying that it can’t load android system and that my data may be corrupted. I can either retry to boot or do a factory reset.

I still have access to fastboot, I try several time to flash twrp and then try to reinstall 105 or 110, but still the same result.

I will go for a factory reset.

… which was resolved for me, luckily.
The update to A.0118 ran without a problem now, too.

Just to be clear for people reading along … you can’t “flash” TWRP on the Fairphone 3.
You just fastboot boot it … or, if you really want to, you can install it once TWRP is booted, which embeds it into the boot partition using an install script, which breaks OTA updates because the boot partition gets changed this way and the updater checks for such partition changes and doesn’t update in this case.

If installing the TWRP stock packages doesn’t work for you, there are stock partition image dumps out there you can flash with fastboot …

3 Likes

I was not sure that installing twrp from twrp boot breaks OTA updates, thanks for clarifying this :slight_smile: