How to root the FP5 and OTA update - at your own risk

Ok, I had been too fast and didn’t check correct system version. After couple hours, I got popup with OTA update again, so my prevous fix didn’t work.

Fortunately with correct boot.img it is even easier (now verified :blush:). You simply reboot after OTA and then flash patched boot image.

  1. Magisk → Uninstall → Restore images
  2. Install OTA and reboot
  3. Install Magisk again

If you have patched boot image you used for original root, you can use it here, so it is as easy as connecting phone to your computer and do:

  1. adb reboot bootloader
  2. fastboot flash boot magisk_patched-....img
  3. fastboot reboot

@yvmuell can you please update top post to reflect this?

BTW, I tried method with installing to inactive slot from Magisk multiple times with small variances in approaches and it never worked. If anybody has simpler approach, please share it.

Does using an “old” boot.img in a new OTA really make sense? :smiley:

I think we’ll have to wait until Fairphone provides OTA zips. These can be installed in recovery and then the Magisk survival script also works!? Until then, it’s probably easiest to flash the latest factory image (with patched boot.img) with the flash script and turn off checksum and data wipe in the flash script beforehand.
:person_raising_hand:

That’s basically what I did, without my long explanation around it.
But this doesn’t solve the problem that you still need a PC after each OTA.
Because you technically unroot your phone every time doing this.

:face_with_diagonal_mouth:

Which is a real bummer, because in my eyes that’s literally not the point of “Over the air”.

But I feel like we are missing something here with ignoring vbmeta, because as I understand it from the documentation, executing the following flash with the “–disable-verity --disable-verification” flags set should force the phone to ignore the hash mismatch:

fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img

https://android.googlesource.com/platform/external/avb/+/main/README.md#what-is-it

But somehow the hashes are still checked and OTA update process throws out errors.

Thats how it would make sense I guess and is working on the FP4 (most times)

Recently it did not work always for some and I think they could not find the reason, its discussed in this topic

[quote=“hirnsushi, post:340, topic:76839”]
The OTA updates are delta updates and don’t contain a full boot.img, you will have to merge the OTA update(s) with the previous factory images to get a usable boot.img.
[/quote]

Wondering if its the same for FP5 and would it mean using this does not really work?

How to root the FP5 and OTA update - at your own risk - #12 by Smojo

Did you both flash the Magisk patched boot.img? In my eyes this should never be done, you would only boot from it…

Edit:

1 Like

Yes, just as suggested in Magisk install instructions.

I’ll try it with just booting next time, but I don’t see it mentioned in install instructions and I’m not sure it would work.

Btw. as asked by @llluuuzzziii - it made sense at the time, as I thougth there wouldn’t be official images available. I might have older kernel, if it was upgraded with OTA, which I suppose (and binwalk on boot.img confirms) is placed on boot partition. But I believe - and please, take in mind that I’m no Android developer, I just know Linux - other parts should be just OK.

And I just realized you probably ment it other way - that there is no sense in doing OTA when you can flash them in recovery. TBH I didn’t know that is possible :slight_smile:

As in the end Firephone is releasing factory zips, I’m going to patch boot.img from FP5-TT3L-factory.zip now and I should end up with everything updated.

I hope somebody will arrive too better way than downloading huge factory zip every time, I would really like to have OTA working.

Btw. I just realized, that situation had been same for me on previous phone with LineageOS. There is even script to automate patching at GitHub - NicolasWebDev/reinstall-magisk-on-lineageos: Small bash script to reinstall magisk after each LineageOS update But huge (in terms of gigabytes :slight_smile: ) difference here is that LineageOS is publishing boot.img for every version, so you don’t have to download everything, just small boot.

Edit: just confirming, that kernel was upgraded in OTA, so I shouldn’t flash old boot image before.

uname_after_ttl3l_patch  	Linux localhost 5.4.219-qgki-g6c1b2060c8b4 #1 SMP PREEMPT Mon Sep 18 19:04:52 CST 2023 aarch64 Toybox
uname_before_ttl3l_patch  	Linux localhost 5.4.219-qgki-g539c83788646 #1 SMP PREEMPT Tue Aug 22 19:22:26 CST 2023 aarch64 Toybox
1 Like

Yup, followed this Instruction to the letter.
And my bash history confirms it… :sweat_smile:

Alright, time to switch the boot partition and try again for lulz =D

The Fairphone factory image has the “small” boot.img inside as well. Just needs to be extracted or are you saying, that Lineage just posts a separate download link to the boot.img file?

Yeah, I know, that is how I rooted the phone :slight_smile: But download from firephone servers is kind of slow and it seems really wastefull to get 2,7GB, unpack it, get small img file, and remove everything else. Network operators are probably happy :slight_smile:

Yes, they have separate boot.img, probably for this use case, for every download. You can see it i.e. here: LineageOS Downloads

It would be great, if Firephone would do the same. I’m not sure about best place to ask for this. Maybe @yvmuell knows?

Okay, so it is like I guessed. =)

It does seem a bit extra to do that for the company, but one can hope. :upside_down_face:

Otherwise, there is still this Forum.
And it’s just a zip, so there could be a way to script a download, extract and re-upload to a Forum post every time there is a new factory image available.

There is only the way through support.

They do it for the FP4 I think, so would hope they will do for the FP5 as well moving forward…

Overall my phone isnt rooted so my comments are rather theoretical trying to transfer FP4 knowledge from others more knowledgable to the FP5 as my expectation is, that the FP4 instructions apply to the FP5 the same way.

2 Likes

Unfortunately this would be extremely insecure. SHA sums are inside that huge archive, so nobody would be able to verify that it is original boot.img and nobody tampered with it.

Cool. I’ll write to support to push this a little, but I suppose they are overwhelmed, its still early after FP5 release.

2 Likes

Oh, right! I forgot about those. Nefarious thinking just does not come natural, when being enthused about tech. :sweat_smile:

I took a small write up of the rooting process I used here:
https://xdaforums.com/t/rooting-fp5.4634181/post-89111662

1 Like

Previous month i doing OTA v106 on rooted without problem (with classic: MagiskApp restore images, Doing OTA without reboot, MagiskApp install to other slot)

But with yesterday 112 update this not work, after reboot, is try load new update from slot B, but after ~15s reboot againd back to A slot with previos 106 system version…

First with Magisk 26.3 as in previous month…

Second i try with latest Magisk 26.4 and result same…

Thirt time i doing this (as still 112 not avaiable for download, but previous 106) :

  • in Magisk restore images (in actual slot A)
  • doing OTA update (to other slot B), don’t reboot
  • in ConnectBot local connection make:
    su -
    dd if=/dev/block/by-name/boot_b of=/sdcard/boot112stock.dd.img

And with /sdcard/boot112stock.dd.img make as first rooting procedure succesfully
(patch file in MagiskApp, via fastboot boot patched , in MagiskApp direct install)

BTW: although on download link is for FP5 still show as last previous 106, is already avaiable 112 for download on direct link: https://fairphone-android-builds.ams3.digitaloceanspaces.com/FP5/A13/FP5-TT3P-factory.zip (this is same official link as for 106 but change TT3L to TT3P in url :wink:
So not need grab boot.img from partition, can be from this zip…

1 Like

Just for peace of mind for anyone wanting this, I thought I’d report that the FP5 with the new manual install of Murena/E functions properly when rooted.

It had been my practice until now to use Magisk v23 on all my rooted devices, as it is the last one that natively supported MagiskHide. I can confirm v23 does not work. Magisk v23 will patch the current Murena boot.img, but doesn’t detect root when booted from the patched image. This was unsurprising since Magisk v23 already had problems on the FP3. However, the latest (v26.4 as of right now) Magisk works, and the addon MagiskHide replacement module also works well on the FP5/Murena.

I don’t know if there are any regional differences, but my FP5 is the UK version (and thank heavens Clove ships to Canada!)

1 Like

To not have multiple topics about root I merged them

1 Like

with current v127 update i have same problem with on-phone reroot and work same method

EDIT: anybody here with succes on-device reroot without problem as i have?