✏ Porting TWRP recovery

Hi Rob,

yes, however you would flash the recovery via fastboot, not via adb…

wort case: phone is dead and won’t turn on and there is nothing you can do about it. However I think that this would be very very very unlikely, as for now you are only messing with the recovery, not with the operating system itself.
If the flashing of the recovery shoul fail, you could simply try again. I don’t see a reason why it shouldn’t work on your FP2 if it already worked on others :slight_smile:

I don’t really know how to make a backup, but yes, it completely replaces the stock recovery and so far Fairphone has not provided the image of the original recovery. I tried doing a backup with flashify, but that app is simply not working on my phone. Freibadschwimmer apparently managed to make a backup of his recovery partition:

yes

was like that for me. time worked fine for me, it just appeared to be a bug at first, because twrp has a random timezone set by default. I set it to Berlin time and everything was right.

For the FP2 you will need to use xposed-v79-sdk22-arm.zip, I dunno what happens if you flash a wrong version, but I also wouldn’t want to try :stuck_out_tongue:

yes

no, it’s quite straight forward. I just downloaded the xposed zip file on my phone and put it into the download folder. TWRP can find it and install it from there…

Hope it clears some stuff up for you :slight_smile:

Moritz

5 Likes

I just felt courious yesterday, so I flashed the recovery and it just works like a charm! :slightly_smiling:
Thanks a lot @Max_S!

I also did this and it’s boring. It doesn’t flash and gives you an error message saying “not compatible”. :wink:

1 Like

Quick one - does this port currently work with encryption?

Grazie!
Root

I can’t tell about that, but it’s in the list of known bugs that it doesn’t work on encrypted phones.

@Max_S: I Just found out why the clock is wrong: :smiley:
The default timezone is set to -6, after setting it to +1 it’s correct. :slightly_smiling:

1 Like

About to backup the original FP2 “recovery.img” I had the idea to use MTK Droid (atlhough I only realized afterwards - as the name implies - it only working for MTK devices :wink: )
So I tried it, as I set it up already for the FP1 some time before and here you see the result.
Unfortunately a backup is not possible, although it is recognised in principle.
Can I do anything more with this?

Do I need to set the phone in any special mode, as I made it during rooting (ther it was bootloader) before entering the above line??
For my i tried this (see pic), but it was quitted with the error message “fastboot not found”.

The FP2 is connected, ADB driver are installed and USB-Debugging is enabled, recovery.img copied to C:, just like during my root-procedure. What did I forget?

Hi Rob,
yes, first of all, you need to set your phone into bootloader mode again, just as you did in the rooting tutorial. However in your example, you changed the path of your cmd by typing cd … twice. You eneded up being in c:\ where your .img file is, but from there the fastboot command is not reachable, since the program is located in the minimal adb and fastboot folder. Instead do the following: run the shortcut from your desktop to go to the commandline, then type:

fastboot flash recovery c:\recovery.img

The command will find both the fastboot.exe and also your recovery.img and you should be good to go…

Moritz

1 Like

By the way, the Fairphone sources include building a recovery image - I was able to go back from TWRP to the stock recovery using that. (Not sure if it contains closed-source parts though.)

2 Likes

Did they change the ota? I downloaded it a while ago, but in the zip I downloaded there was definitely no recovery included… Can’t check the current one though, so since I’m on the bus ATM…

Sorry, my bad… Some unpacking error…

If you want to make a backup of all the partitions except the original recovery: Flash (or boot; see first reply to this post) TWRP, go to Advanced -> Terminal Command and just click “Select”

Then enter the first of the following 3 commands and press “Go”. Delete the line and enter next command etc

  1. mkdir /sdcard/backup

  2. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ;do dd if=/dev/block/mmcblk0p$i of=/sdcard/backup/part$i.dd; done

  3. dd if=/dev/block/mmcblk0rpmb of=/sdcard/backup/partrpmb.dd

You will now have a raw image of all the partitions on the phone on the internal storage. Move them to a safe place on your computer. They can be flashed back in case of emergency. No instructions here, cause really dangerous.
This will not copy data as it shares a partition with the internal storage

1 Like

@Moritz: Thanks for your very helpful and kindly comments, as well for the compilations work.

Thanks to you guy I finally could install successful GravityBox to my rooted FP2 !!!
I hope now better times start for the yet difficult relation between my FP2 and me (who are used to a GravityBoxed FP1)…

I updated the wiki for a more detailed installation guide for your compiled recovery.img!

Thanks, Thanks, Thanks!

5 Likes

Today I finally had time to flash twrp

Two questions:

  • any plans to implement reading an encrypted /data partition?
  • TWRP does not see my sd card. After rebooting, stock os does see it. Does anybody else experience this? (Edit: works if I allow /system to be rw)

@therob good to hear that! :slight_smile: did you succeed in hiding the icon for the second ,empty sim? It was the main reason I installed gravitybox, but it simply did nothing on my FP2…

Since I use both SIMs I cannot check this right now. But if you wish, I can give my FP2 a peeling and can check it.

What I struggling with GB@FP2:
I could not manage until now, to use the GravityBox-Shortcut-Settings as I could with the FP1. There I had the setting, that by a sweep-down of the status-bar at the side (e.g. right), directly the settings menu with configurable ssetting toggles appeared and not show the notifications first…

I now activated it also at the FP2, but still the annoying Android5.1-setting appears, and still only after two sweeps, what is the most annyoing behaviour of this damn setting panel.

So either I still missed any setting in GravityBox, or it does not work with FP2 / Android5.1…hm…

I just opened a wiki about GravityBox@FP2 where we can discuss working and not working features…

1 Like

Yes, I know that. But it doesn’t work for me. Also clock is wrong when I boot into normal system until it receives the current time from the network. I’ve read something that there is no RTC in the system. Maybe I also messed something up on building my system. Do you use the stock firmware?

Problem is that some hardware parts are used for encryption. I added a link to a thread where some people seem to got it running. Unfortunately I didn’t had time so far to try it. But please feel free to do so and post your experience here :smile:

Maybe you need to explicitly mount it in TWRP. I’m not totally sure but I think I needed to do this as well.

1 Like

Hi.

You do not neccesarily need to flash TWRP for using it. Instead of flashing it you can boot it straight from your PC. This is what I recomment before flashing anyrhing anyway. In the command line simply replace ‘flash’ by ‘boot’.
This way you can probably even backup the original recovery.
However, I don’t know what I would want with this crappy piece. :wink:

2 Likes

Yes, right now I’m seeing up anything (again) for compiling system AND twrp… Just thought because this here is some kind of “reference implementation”.

Iirc, after allowing twrp to make modification to the system, it also was able to mount the SD card…

I use the stock image and everything works with the clock, even after reboot. :slightly_smiling:

Thanks, #Max_S. I have done straight this:

And it works! I have TWRP and XPosed, XPrivacy and Gravity box running!

1 Like