• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

CodyF86

Senior Member
Jul 4, 2013
1,452
3,921
35
Grand Junction, CO
Last edited:

dumdedumda

Member
Sep 4, 2010
10
1
@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,452
3,921
35
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,452
3,921
35
Grand Junction, CO

crisagler

Member
Feb 1, 2013
35
26
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
 

CodyF86

Senior Member
Jul 4, 2013
1,452
3,921
35
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,452
3,921
35
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,452
3,921
35
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
114
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,452
3,921
35
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

CodyF86

Senior Member
Jul 4, 2013
1,452
3,921
35
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,019
1,886
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

  • There are no posts matching your filters.
  • 2
    https://t.me/MotoUpdates/1118 <-- link to the rom for those interested
    1
    Supposedly this one works?
    Not supposedly, it works great
    1
    Not supposedly, it works great
    Well I've been reading the thread and it seems like there's mixed responses so I'm hesitant to flash it.
    1
    Supposedly this one works?

    Don't take this as a dismissive suggestion to just go do research but I do strongly recommend that you read all the posts in this thread as well as the documentation and the links provided. I'm in the same situation as you, considering unlocking boot loader and routing my Moto Sofia. Here is what I've gleaned so far from digging into those resources and from recent (unpleasant) expediences with A/B devices.

    Some of the instructions seem to indicate that TWRP can be flashed via fast boot but for some time I've had the understanding that this is not recommended on A/B devices such as this one. On other A/B devices I've flashed TWRP by booting to TWRP.img via ADB then installing the ZIP file from within the ADB booted TWRP, but for this device I don't see a ZIP version of TWRP which would be used for that method. Additionally if you dig into the notes in this thread (as it seems you have already done) there are people who report absence of touchscreen response which I myself as a have experienced on a different device. That particular symptom in my experience was not exclusively associated with a particular TWRP version. Just FYI.
    1
    I share your hesitancy for reasons mentioned in my previous post and for the reasons you mentioned. I may be a bit out of date but in particular I'm wondering if there is still a need to flash a zip to copy partitions from A to B or to do it manually and whether or not the boot partition of the ROM will remain intact is the IMG file is flashed via fast. As in your case I am having trouble piecing it all together to paint a reassuring picture. That being said I'm delighted that @CodyF86 has put this thread together and is working on it and also glad to see a long time maintainer of Moto devices, vache, being a source of the material.
    I'm no stranger to rooting and what not but I've got no experience with this phone so far. My last phone I modded was LG V20.
  • 21
    Here you go : https://drive.google.com/file/d/1x4t6ca8TLf1bNHrQa-jjCN_AhdV2W78u/view?usp=drivesdk
    Boots on sofia (g power), sofiar (g8 power), sofiap (g stylus), sofiap_ao (g pro)

    I started the thread, but did not make this build. Everything should work. Thank @vache.
    10
    Here she is boys.

    sofia-twrp-3.4.0-0

    The touchscreen works, you just need to cycle the screen off then back on with the power button once its booted.

    decryption is still iffy a lot of work to do. Had to do some messing around with the image, the build system / device trees are still weird.
    10
    Here you go : https://drive.google.com/file/d/1x4t6ca8TLf1bNHrQa-jjCN_AhdV2W78u/view?usp=drivesdk
    Boots on sofia (g power), sofiar (g8 power), sofiap (g stylus), sofiap_ao (g pro)
    9
    Don't fret though. :) I will make it work...

    Here is a video so far:....


    TWRP-(Android-10) booting on Sofia
    7
    Quick update I did get TWRP to build successfully. Unfortunately it just sits on the boot logo but doesn't go back to fastboot, but that was just a quick see what happens build. I haven't added everything I need to yet. Will work on it more tonight, but progress is good so far. :)