chaosmaster / android_device_fairphone_fp3

TWRP device tree for Fairphone 3
30 stars 6 forks source link

Loop to Recovery after installing TWRP_12 #8

Open bege10 opened 11 months ago

bege10 commented 11 months ago

Hello, I want to install twrp-3.7.0_12 permanently on my FP3 (/e/OS-S-dev rooted with Magisk) as is with v3.7.0_9.

I did as usual: boot twrp.img and then try to use Flash Current TWRP. But that throws and error that the ram disk has been changed and twrp cannot write to it. Is that normal for this build? So I used the alternate way Install Recovery Ramdisk. Afterwards I rebooted to recovery and v3.7.0_12 was installed. But booting to system does not work any more. The phone always boots to recovery.

Installing the previous boot.img (twrp-3.7.0_9 patched with Magisk) solved the issue and I can boot to system again.

What might cause the issue? Is there something wrong

kolAflash commented 10 months ago

Same problem here. OS: IMG-e-1.12.3-s-20230616300623-dev-FP3.zip

System boots again after reflashing Magisk.v26.3.apk. And twrp-3.7.0_12-0_k4y0z-20230821-01-fp3.img still works too.

_See also: https://github.com/TeamWin/android_bootable_recovery/issues/297#issuecomment-1666642680_

chaosmaster commented 10 months ago

I would generally advise against installing TWRP permanently on devices that don't use a separate recovery partition like the FP3. To install TWRP the ramdisk of the boot partition needs to be modified/replaced which will also result in Magisk being removed (since it also modifies the ramdisk). If you do install TWRP you should also reinstall Magisk afterwards, as @kolAflash did.

PinkSerenity commented 7 months ago

For me, flashing TWRP to Ramdisk manually causes a bootloop to the bootloader. Selecting "Flash current TWRP" instead throws the same error, even though the Ramdisk files haven't been modified because I hadn't installed Magisk. @kolAflash suggests reflashing Magisk, which however doesn't work for me either.

In the Fairphone forums I have theorized that the issue is the tool magiskboot, which, as far as I know, is responsible for modifying the boot partition in both TWRP and Magisk. Magisk builds before 26.2 had some kind of issue that they didn't work with Fairphone's changes to the boot image when they retrofitted dynamic partitions. The behaviour people observed back then was very similar to this. Maybe the image still uses the old build?

Edit: magiskboot, last commit date 4 years ago

PinkSerenity commented 6 months ago

Took me quite a while to build it (didn't have the hardware and setting up GitHub Actions was difficult), but I managed to fix it. Both Flash Current TWRP and Install Recovery Ramdisk work flawlessly. The only thing I did was replacing the magiskboot binary I mentioned above (unfortunately not the newest version), the other commits are various attempts to work with Actions. Here's a temporary image, I will take the repository down once it isn't needed anymore. https://github.com/PinkSerenity/android_device_fairphone_fp3/releases/tag/20240215

Edit: I'm terribly sorry and feel incredibly stupid. It still doesn't work, I just realized I had flashed an older image I had used for testing purposes. Sorry for notifying everyone. Keep on looking, I guess... but this should be the solution somehow. The new image does however fix the Flash Current TWRP issue.

bege10 commented 2 months ago

Same problem here. OS: IMG-e-1.12.3-s-20230616300623-dev-FP3.zip

System boots again after reflashing Magisk.v26.3.apk. And twrp-3.7.0_12-0_k4y0z-20230821-01-fp3.img still works too.

_See also: TeamWin/android_bootable_recovery#297 (comment)_

You recommend reflashing Magisk apk afterwards. This is not recommended in Magisk install manual, instead patching boot.img and flashing that is recommended. But patching without being able to boot to OS is not possible. Does flashing Magisk apk right after installing TWRP work correct?