Hirnsushi can you please send me an email at [moderator edit: removed email, please use Forum DMs]. I made this account just to get ahold of you. I am from xda developers. There’s a community here that is interested in doing some things with the fp4 that could need your help. If anyone is reading this that is a developer and good with Qualcomm programming. Shoot me a message as well. Will pay $$$ for bounty.
Hi. I patched boot.img on my new FP4 and reboot from that as @hirnsushi says. I installed Magisk with mobile data, because WiFi don’t works. After another reboot I installed LSposed and Gravity Box and all seems working fine.
You are not supposed to flash the boot.img, only boot from it and then run magisk installation
Actually, with the way to get kernel images @rar0 discovered it’s possible to directly flash a patched boot.img
The old way has the benefit of not having to look up your build number and less ways to flash wrong stuff, but it certainly is slower… your choice
Oops! You are right, thanks… I have rectified the mess in my post
Hello Everyone!
I obtained root with hirnsushi’s solution (thank you for that btw) but reverting did not work (or whatever else I was actually doing).
After I installed and set up Magisk, I played around a bit and then decided to do a Factory Reset. (At some point before or after the FR I also booted with the original boot.img from the Fairphone Source Code Website, dont know whether this is relevant)
Well… after all of that, the phone booted into the “Erasing…”-Screen for a short moment. But after that the phone loops with the “Unlocked Bootloader” Warning, some seconds of the Fairphone Logo and a reboot.
I already tried doing a Factory Reset from the Recovery Mode and also read the Troubleshooting from the Support but without a solution.
Could the flashing of the original system-image be an possible solution (not available yet) or can someone help me any further please?
The original boot.img is ancient, never flash that.
Are you still able to directly boot any of the boot images with $ fastboot boot boot.img
? That would at least tell us it’s actually the boot partition causing problems.
If that’s the case I’d suggest first switching to the other boot slot in fastboot (not at a PC right now, will have to post that command later) and if that doesn’t work flashing a newer boot.img (method to get it above ).
you get it working again
Thank you @hirnsushi, yes I can boot images. Will try the switching first.
Just a note ibw: If I boot from the patched boot.img the phone stays a little bit longer at the “Fairphone”-Logo and then shuts off, no reboot.
Alright, switching boot slots worked, Thank you @hirnsushi!
Do you know what to do with the corrupt slot?
Commands used, for everyone interested:
Get the current active boot slot:
fastboot getvar current-slot
Select the other slot: (either “a” or “b”)
fastboot --set-active=b
Great you got it working again
I wouldn’t worry to much about the unbootable slot, it will be reflashed with the next system update anyway. But if it bothers you, you could always extract your working slot and flash it onto the other one. I wouldn’t but you could
Backup a copy of your working slot though, just in case.
Is it possible to make a copy of a slot without root?
Yes, one way to do it is essentially half the root guide without actually rooting your phone:
- Get Magisk and patch any boot.img you have lying around
-
$ adb reboot bootloader
and$ fastboot boot patched_boot.img
$ adb shell
-
$ su
and finally# dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img
for example to get boot_a - then just
$ adb pull /sdcard/boot_a.img
I believe there is the possibility to directly dd
the boot partition to your PC, don’t remember that syntax right now, sorry
Aha sounds interesting, but for my understanding the slot don’t contain the whole rom? I am on A94 boot is your earlier root guide still working? I really want to try it but i don’t want to damage my mobile. I always root all my mobile phones.
Yes, those A / B slots only contain the boot partition. When performing a system upgrade the new boot.img (so your kernel and related stuff) get written to the unused slot and at reboot your system changes to that slot. Other A / B slots (like modem, recovery…) might be updated as well, depending on the update.
I don’t know of a method to completely dump your whole system at the moment, certainly not into a reflashable custom rom kind of image. Maybe it’s possible with TWRP, haven’t looked into it. The only available TWRP for the FP4 doesn’t have access to encrypted /data
anyway, so no reason to try
I can’t tell you if root still works on A94, my provider apparently doesn’t want me to update just yet. But I see no reason why it wouldn’t and early reports seem to indicate it does.
If you aren’t comfortable on the command line and with some hands on troubleshooting I wouldn’t suggest rooting at the moment, since there are still no easily flashable rom images available to recover from some worst case scenarios.
I am familiar with Linux and commandlines input but not an expert in it. I guess I wait some more. It should be possible soon to reflash everything when things go wrong. Many thanks for the information and giving root as an option.
I can confirm root works with A94.
As for the update not showing up you might have the same issue I had, rooting and messing with gapps basically seemed to prevent the update to show up.
I wiped my phone (after breaking too many things by trying to get Google maps to work with microG) and the second my freshly wiped device grabbed an internet connection, the update showed up…
Yeah, I suspected that might be the case. But I’m in no rush to update, so I’ll first mess up my install enough to actually warrant a factory reset
I have written down this procedure in some more steps as it took some tail-and-error. Feel free to provide feedback: Fairphone 4 – Root -December 2021 – Stijn D'haese
Also, any spelling errors are free of charge.
Very clean tutorial
Thank you for your work
thank you very much!
however unfortunately it didn´t work out for me.
previously on FP4:
I was rootet on magisk for 2 weeks with A.067 image and everything was nice with lawnchair etc.
I used Titanium Backup and it looked like it worked. Except MiXplorer - search didnt work
Deactivated majority of google apps - no MicroG
for the update:
first: I tried factory reset only. Update failed.
second: I returned to stock boot.img (my build no. is quite strange: A.081) according to your prescription.
no wifi, no sound any more.
first notice after reboot always: UI crashed (but it works fortunately)
third:
I tried to switch to slot b
after reboot its again in slot a
fourth/fifth… etc…
tried different boot images: A.091, A.094 that you posted
and from Hirnsushi´s post here
FP4 Root Access is possible, maybe a bit risky - #43 by hirnsushi)
now I am back on patched A067 Image from my first root.
still no sound and no wifi:(
And just noticed: no calls. Incoming and outgoing aaarg!
anyone has a clue?
I tried to enable WiFi with adb and the command??? lines from there:
https://code.fairphone.com/projects/fairphone-4-kernel.html