I would still not recommend flashing the boot.img!
If you just fastboot boot it and install Magisk through the app (like outlined in the instructions) Magisk creates a backup of the stock one, which you can just easily restore through the app once an OTA update arrives.
Then all you have to do is install Magisk to the other slot before rebooting and you’re good to go. (Unless you are one of the unlucky ones with a module that breaks this process)
That’s better actually, yes! Just for clarification and clarity: how would you go about installing Magisk to the other slot? That exact procedure seems a little unclear to me, although I have an idea (boot_a, boot_b), is that what you mean? If so, what’s the default slot used by the Fairphone 4 OS and what would be the default slot for Magisk?
@yvmuell already linked the instructions, just some further clarifications:
It’s an install option in the Magisk app
A/B and the corresponding partitons are the slots, but there is no default slot (I mean there is a slot you start on when installing factory images, but that’s not the default in that sense).
When an OTA update arrives it gets installed to the slot you aren’t currently using, the next reboot swirches to that slot and if the boot is successful you’ll continue in that slot (otherwise it should fall back to the previous one, should … ).
Now the problem is that FP delivers OTAs as delta updates, so the update takes the selected partitions from your current slot, applies a patch, and writes the result to the new slot. For that to work the partitions have to be exactly as expected, so they get checked against a known hash for each partition.
But Magisk modifies boot, the hashes don’t match, and the update fails.
To solve that problem you have to restore the stock boot.img beforehand, so the OTA updater is happy. Since you (hopefully) didn’t reboot at that point you are still running a rooted system (from RAM), even though the actual system partitions are stock.
Now, the updater has set the system to boot into the other slot on the next restart, so we use the still present root to directly install Magisk to that slot. If everything went well (you aren’t one of the lucky ones with module issues) the next boot switches you to a rooted updated system.
Rinse and repeat for every OTA.
(Side note: If there’s an Magisk update in between OTAs, restore the stock image through the app before installing it so Magisk creates a new stock backup and the process keeps working)
Please some advice with bugs after updating to 079 and rooting with Magisk.
After rerooting, Fairphone 4 in unstable state, lots of errors and problems. By mistake, the 069 version boot image patched with Magisk Manager was flashed, I did not follow the instructions not to reboot the device after OTA to patch Magisk into the update slot. Please help.
Device is now running proper boot.img with Magisk patched, however damage is done.
dmesg and logcat show countless errors of the type no such file or directory, selinux audit avc denied file not found, insufficient permissions, access denied.
Symptoms are: boot loop sometimes, 3 navigation buttons not working, no sound, no notifications, application switcher does not work or is buggy, settings are forgotten on every reboot, developer settings do not open, mobile data cannot be disabled, can’t launch application info from launcher, apps crashing, general buggyness and weird behaviour.
I figured it had to do with broken selinux context but according to dmesg these are loaded correctly.
Does not matter for the problems if I am booting boot.img with magisk patched or not.
Something is seriously wrong, already early up in the boot process. Perhaps paritions are tampered with?
Can I reflash or fix it in a way while keeping /data and internal /storage? Will a factory reset help partition or faulty update problems?
Hi. I cannot root the phone after applying this update. After patching the boot.img and booting from it, Magisk says that it is not installed. Tried with Magisk 23, 26.1, and 26.3. I also tried to boot from my previously working boot.img (B.079) which took longer to boot and had some bugs, but still: Not rooted. Bootloader is unlocked.
Thank you for moving and your quick response! Yes, I tried with B.086 as B.089 does not seem to be available for me and I could not find it anywhere else to download. I also read through this thread, but several suggestions (e.g., “boot first only, do not flash” or “check boot slot”) did not help. Before I have to wipe my data and go back to B.079, I just wonder whether this can be fixed.
Hi. I solved the issue that I created myself. After reboot, I installed the latest Magisk (26.3), although Magisk 26.1 was already installed, but hidden. This new Magisk did not show that the boot.img was patched. By chance, I just spotted that my hidden Magisk app is back and after opening it, it requested to perform additional steps. (You may know what I mean.) After this, the phone was rooted again successfully.
I was trying to root my phone, but I am currently in a bootloop.
I followed the steps described by hirnsushi in post #43.
I used the boot.img B.069 even if there were more recent releases because it has been 4 months since I last updated my OS,
and the method described to know my Build number didn’t help me.
I entered this boot.img in Magisk
I transferd the patched boot.img on my PC
I rebooted to fastboot,
booted with the patched boot.img (without flashing it)
Waited for the device to boot (took a bit longer)
Opened Magisk (did not get the Additional Setup ask), chose direct install and rebooted.
Got in a bootloop : after 2 or 3 loops (fairphone image > unlocked warning, no /e/ image, back to Fairphone image) I land on recovery page (try again/factory reset, or back arrow that sends me to the page where I can choose between reboot, update, factory reset or advanced, where I can enter fastboot/booloader/recovery/etc
I tried to change slot but it did not help.
I need to root my phone in order to image all my data, hidden somewhere after a factory reset not wanted (nor consented by me) but that’s another problem I’ll see later.
First I need to get out of that bootloop.
Can somebody help me please ?
Oh… okay. I am let’s say a bit lost, so I’m trying everything I can…
My intention was to try a tool like diskdigger but it needs to work on a rooted phone.
Now I end with a bootloop so I try to come back to previous state…
I’m afraid you won’t have much luck with disk digger, since newer versions of android enforce encryption for userdata and you don’t have access to the decryption key after a factory reset. So any data you could recover using such a tool would be nothing but an encrypted mess without that key…