[Sofia(p)(r)][Recovery][WIP] TWRP 3.4.0.0

Search This thread

dumdedumda

Member
Sep 4, 2010
29
13
@CodyF86 thanks for taking the lead on porting TWRP to the G Power. The G Power appears to be the best "bang for the buck" phone on the market currently, and has been widely covered by the media so far. I expect that the Moto G Power sub will grow steadily in the upcoming months, leading to custom rom development for the G Power. Having TWRP ported would be a start to paving way for custom rom development.
 

CodyF86

Senior Member
Jul 4, 2013
1,457
3,923
38
Grand Junction, CO
So another quick little update. I have the device repo basically where it should be...give or take heh. It's changed a bit from what is on my github, but it's pretty close. The only issue i'm having is that compiling it with the minimal manifest isn't going to work. It doesn't compile right. It compiles, but it doesn't copy things over correctly and/or at all depending on what it is.

My repo is pretty close to what the moto one power and the g8 power have, at least for their android 9 device tree, and I can get TWRP to boot, if I use the moto one power image and just dump the moto g power kernel into it.

So short version is i'm downloading the full manifest, basically all of Omni, which should hopefully sort it out. It's downloading right now.

EDIT:

Actually it helps to read the documentation I guess lol.

https://source.android.com/devices/bootloader/system-as-root#using-vendor-overlay

Will keep playing with it. :)
 
Last edited:

CodyF86

Senior Member
Jul 4, 2013
1,457
3,923
38
Grand Junction, CO

crisagler

Member
Feb 1, 2013
35
27
Santiago
Quick question, is the Moto g power the same as Moto g8 power? If they get custom Rom they'll unified? From what I know, the g power is the us variant release of the g8 power, right?. Thx in advance
 
  • Like
Reactions: MindaABe

CodyF86

Senior Member
Jul 4, 2013
1,457
3,923
38
Grand Junction, CO
Been making changes and even trying to repack some files from our devices into chef from when I got chef to boot with a repacked kernel but the touch screen wouldnt work and it couldnt see any partitions really.

Part of the problem seems to be the build system. It's not populating the output image fully. It's not even putting the TWRP directory in there lol.....

Going to keep trying. Going to try to find a native android 10 device that has twrp working unless there isnt one yet. Also our device is a little different it actually puts certain things in /system where in android 9 they went into /vendor. Spent about 3-4 hours on it today, but not going to give up.

I think there is an issue with the OMNI build system though also.
 

rlrevell

Member
Dec 18, 2019
16
5
Been making changes and even trying to repack some files from our devices into chef from when I got chef to boot with a repacked kernel but the touch screen wouldnt work and it couldnt see any partitions really.

Part of the problem seems to be the build system. It's not populating the output image fully. It's not even putting the TWRP directory in there lol.....

HI, I'd be willing to help with this, I'm a developer, I worked with @tecknight on TWRP for a phone called the Wiko Ride. We never quite got a working TWRP but learned quite a bit about AVB and such. I've already got my Sofia (US unlocked retail, running on Boost Mobile) rooted and could use a new challenge.

I too have been quite baffled by the Android build process at times - the docs that exist seem to assume a LOT of prior knowledge - the barrier to entry seems higher than ordinary Linux kernel hacking by quite a bit.
 

CodyF86

Senior Member
Jul 4, 2013
1,457
3,923
38
Grand Junction, CO
HI, I'd be willing to help with this, I'm a developer, I worked with @tecknight on TWRP for a phone called the Wiko Ride. We never quite got a working TWRP but learned quite a bit about AVB and such. I've already got my Sofia (US unlocked retail, running on Boost Mobile) rooted and could use a new challenge.

I too have been quite baffled by the Android build process at times - the docs that exist seem to assume a LOT of prior knowledge - the barrier to entry seems higher than ordinary Linux kernel hacking by quite a bit.

Look at my github you can see the cluster ef of changes I made to at least get to a console. Ironically if you repack the kernel into the chef version of TWRP it boots to the GUI but the touch screen doesnt work.. Our device is weird although it is android 10 native but it has a /system folder. Also on android 10 you can just add things to the vendor partition without using the product partition as an overlay.

Unpack the stock recovery. I went back to the basics and am basically going to mirror the stock recovery then inject the twrp binary, but its weird, the omni build system isnt doing some things correctly it seems also.

This will be your greatest resource. Code Aurora has the answers. :)

https://source.codeaurora.org/quic/la

https://source.codeaurora.org/quic/la/platform/vendor/qcom/trinket/tree/?h=LA.UM.8.11.r1-03800-NICOBAR.0
https://github.com/codyf86/device_motorola_sofia

LA.UM.8.11.r1-03800-NICOBAR.0 is our current CAF version tree.

Actually I just started the repo over the commits were nasty. Everything important and pertinent is in the initial commit now.

Ive been compiling and hacking kernels for 10 years, building Android for probably the same and this switch to the new partition layout + TWRP has so far been the... I don't want to say hardest but longest thing i've tried to do without any forward movement.

Like I said I got farther just by repacking the our kernel into the moto chef kernel, but they have a system_root directory and we dont. We just have system.

Theyre lib64 goes in /vendor ours goes in /system.

unpack the stock recovery image to start also TWRP uses init.qcom.recovery.rc to do things on the init and init.rc hand off where as stock recovery version of that file is different.
 
Last edited:
  • Like
Reactions: mindmajick

CodyF86

Senior Member
Jul 4, 2013
1,457
3,923
38
Grand Junction, CO
The current code I have on my github will boot the stock recovery lol (the build system is being weird)....the build system isn't putting things in the right spot still. I was able to get TWRP to boot by rearranging some things manually, but it isn't pretty. So there is some progress, but the build system is part of the problem at this point at least for android 10. I'm still working on it.
 

Dark98

Senior Member
Jan 10, 2013
116
102
The current code I have on my github will boot the stock recovery lol (the build system is being weird)....the build system isn't putting things in the right spot still. I was able to get TWRP to boot by rearranging some things manually, but it isn't pretty. So there is some progress, but the build system is part of the problem at this point at least for android 10. I'm still working on it.

Hey, do you have a telegram account for easier conversing? I feel we might be able to help each other here?(I'm working on sofiar)
 

CodyF86

Senior Member
Jul 4, 2013
1,457
3,923
38
Grand Junction, CO
Hey, do you have a telegram account for easier conversing? I feel we might be able to help each other here(I'm working on sofiar)

I can make one and ill dm you.

Here are my questions so far / some observations.

The init.rc that the twrp build system puts in the build is incorrect. It needs to be manually added...I think there is a flag for that actually, but I had to change it once it was built. (I was able to make it boot to the first screen by dropping in things in /sbin from https://github.com/TeamWin/android_device_motorola_chef)

The build system doesn't add the twrpres folder to the built image lol; or the twrp binaries to /sbin.

I literally had to copy them over from chef.

Also for example servicemanager and hardwaremanager aren't in the chef repo but they are in /sbin when you unpack the recovery image (chef), is the build system building them or putting them in from somewhere or are the repos not actually the final product and they had to hack the image a bit too.

I had ours added in then took it out when I couldnt find them in anyones device tree but they are there when you unpack all of the recovery images lol.

edit: It's actually putting most of the stuff (adbd) and symlinks in /system/bin including the recovery bin which is twrp, so let me readjust the init scripts.

our device is different it still has /system and not system_root.

another edit: Looking at android_bootable_recovery/crypto/ex4crypt I think im missing some libraries still.
 
Last edited:
  • Like
Reactions: mindmajick

Dark98

Senior Member
Jan 10, 2013
116
102
Okay, if/when you do message me on there please, I hardly check XDA other than when I'm updating a Rom I maintain? @Dark998 is my username
 
Last edited:
  • Like
Reactions: mindmajick

CodyF86

Senior Member
Jul 4, 2013
1,457
3,923
38
Grand Junction, CO
@CodyF86
Interested and surprised to see that twrp for native android 10 is in the works.
After reading Dees Troy's article in late 2019 regarding twrp on android 10, I had resigned myself to the notion that twrp is more or less dead for android 10+...
https://twrp.me/site/update/2019/10/23/twrp-and-android-10.html
Hope you're able to get it working!

I was absolutely able to get it to boot with adb up but with no touch screen and it couldn't see any paritions, but ive adjusted the fstab file.

Also slightly embarassed to say I repo synced and forgot to drop twrp 10 back in, but i need a libinit with twrp 10 and it actually gave me a couple solutions to that accidentally doing that, accidentally building aosp recovery once time lol xD
 
  • Like
Reactions: mindmajick

Q9Nap

Senior Member
Feb 13, 2009
1,018
1,893
I was absolutely able to get it to boot with adb up but with no touch screen and it couldn't see any paritions, but ive adjusted the fstab file.

Also slightly embarassed to say I repo synced and forgot to drop twrp 10 back in, but i need a libinit with twrp 10 and it actually gave me a couple solutions to that accidentally doing that, accidentally building aosp recovery once time lol xD

I was thinking that if twrp isn't possible, how difficult would it be to modify stock recovery to remove signature verification?
With stock recovery signature verification disabled, at least side loading would be possible. Thoughts?

Also, I'm willing to help test if needed :)
 

Top Liked Posts