[OFFICIAL][RECOVERY] TWRP for Moto G LTE (peregrine)

Jalipero

Member
Aug 3, 2015
34
1
0
Kilmarnock
if you come from 4.4 KK, you need the LP radio firmware.

You need to:
Backup your custom ROM
Wipe EVERYTHING (data, caches, system and Internal memory)
Flash the LP radio (that will allow your SIM, wi-fi, etc to work on LP+ ROMs)
And last but not least flash Rom, GAAPs and a custom Kernel if you like.

https://forum.xda-developers.com/moto-g/4g-development/rom-stock-motorola-4g-lollipop-rom-t3142816

You can also install twrp without the app. With fastboot for example. Look here, it will be described. App Install Method Requires Root

https://twrp.me/motorola/motorolamotog2013lte.html
Cheers @Rob..., I remembered I had adb tool kit install and used fastboot to install twrp onto it, and wiped it and installed 4.4, but still no radio. I will try again and dig out the lollipop radio and install it seperately. Thanks.
 
  • Like
Reactions: Rob...

bennett78

New member
Feb 2, 2018
2
0
0
Fort Collins
Need help with TWRP recovery

Trying to unbrick my Moto G XT1064 8GB,
a learning Android thing at this point before I deep six the phone.
[m]flashboot flash anything doesn't seem to work.
I apolygise if this is not the best thread...progress follows:

>>>Power BTN, Volumn Down
AP Fastboot Flash Mode (S)
48.87 (sha-1b80345, 2016-06-30 15:51:18)
CPU: NSMB226 CS
eMMC: 8GB SanDisk RV=D6 PV=07 TY=17
DRAM: 1024KB Elipida S4 SDRAM DIE=4GB
Battery OK
Device is UNLOCKED, Status Code: 3
Transfer Node; USB Connected
# fastboot devices
ZX1D526VJL fastboot
# mfastboot flash recovery twrp-3.2.1-0-falcon.img
target max-sparse-size: 256MB
sending 'recovery' (9590 KB)...
OKAY [ 0.358s]
writing 'recovery'...
OKAY [ 0.174s]
finished. total time: 0.532s
>>>> recovery hangs Unlocked, white backlite screen

# mfastboot boot twrp-3.2.1-0-falcon.img
>>>> I get moto logo, then teamwin logo
# adb shell
~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 446224 20 446204 0% /dev
tmpfs 446224 4 446220 0% /tmp
/dev/block/mmcblk0p35
538320 9364 528956 2% /cache
/dev/block/mmcblk0p38
5773168 4578664 1143448 80% /data
/dev/block/mmcblk0p38
5773168 4578664 1143448 80% /sdcard <<<<< Wrong
~ # umount /sdcard
~ # mount /system
~ # mount /firmware
~ # mount /dev/block/mmcblk1p1 /sdcard/
~ # echo SYSTEMLESS=true>>/data/.supersu
/sbin/sh: can't create /data/.supersu: Read-only file system
~ # mount -o remount -w /data
~ # echo SYSTEMLESS=true>>/data/.supersu
~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 446224 20 446204 0% /dev
tmpfs 446224 8 446216 0% /tmp
/dev/block/mmcblk0p35
538320 9364 528956 2% /cache
/dev/block/mmcblk0p38
5773168 4578664 1143448 80% /data
/dev/block/mmcblk0p36
1112708 1041884 70824 94% /system
/dev/block/mmcblk0p1 63920 48420 15500 76% /firmware
/dev/block/mmcblk1p1 15474688 1283584 14191104 8% /sdcard
~ # alias l='ls -sF'
~ # l /sdcard/
32 ANY KK FIRMWARE TO 4.4.4 GPE.bat*
96 AdbWinApi.dll*
64 AdbWinUsbApi.dll*
32 Android 5.x TO 4.4.4 GPE.bat*
380928 Blur_Version.21.11.23.titan_retuaws.retuaws.en.US.zip*
47168 NON-HLOS.bin*
32 Root/
32 SIDELOAD LOLLIPOP.bat*
6752 SR5-SuperSU-v2.82-SR5-20171001224502.zip*
32 XT1033/
864 aapt.exe*
800 adb.exe*
10240 boot.img*
32 flashfile.xml*
736 fsg.mbn*
32 gpt.bin*
544 linux-fastboot*
96 logo.bin*
544 mfastboot.exe*
1984 motoboot.img*
224 osx-fastboot*
10240 recovery.img*
32 servicefile.xml*
255872 system.img_sparsechunk.0*
245984 system.img_sparsechunk.1*
235712 system.img_sparsechunk.2*
~ # top
Mem: 62232K used, 846216K free, 0K shrd, 2712K buff, 13160K cached
CPU: 0.0% usr 100% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 11.00 8.91 4.55 2/125 200
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
151 1 root R 29112 3.2 0 99.6 /sbin/recovery
198 181 root R 11376 1.2 0 0.2 top
162 1 root S 14880 1.6 0 0.0 /sbin/adbd --root_seclabel=u:r:su:
181 162 root S 11376 1.2 0 0.0 /sbin/sh -
199 162 root S 11120 1.2 0 0.0 /sbin/sh -
148 1 root S 10064 1.1 0 0.0 /sbin/ueventd
1 0 root S 10060 1.1 0 0.0 /init --second-stage
140 2 root SW 0 0.0 0 0.0 [mmcqd/0]
24 2 root SW 0 0.0 0 0.0 [kworker/0:1]
31 2 root SW 0 0.0 0 0.0 [kworker/u:1]
3 2 root SW 0 0.0 0 0.0 [ksoftirqd/0]
137 2 root SW 0 0.0 0 0.0 [kworker/u:4]
168 2 root SW 0 0.0 0 0.0 [kworker/0:3]
146 2 root SW 0 0.0 0 0.0 [mmcqd/1]
7 2 root DW< 0 0.0 0 0.0 [kworker/u:0H]
166 2 root DW 0 0.0 0 0.0 [mdss_fb0]
27 2 root SW< 0 0.0 0 0.0 [kworker/0:1H]
39 2 root SW 0 0.0 1 0.0 [system]
40 2 root SW 0 0.0 1 0.0 [khubd]
41 2 root SW 0 0.0 1 0.0 [irq/102-msm_iom]
~ # cd /sdcard
/sdcard # /sbin/flash_image recovery recovery.img
failed with error: -1
 

bennett78

New member
Feb 2, 2018
2
0
0
Fort Collins
Why are you trying to flash a recovery for falcon (Moto G 1st gen) on a titan device (Moto G 2nd gen) and then post in a peregrine (Moto G 1st gen + LTE) thread about it?
Obviously this xda newbe is not sure what a MOTO G XT1064 needs. My guess is 2nd gen. I would be happy getting back to a factory image !!
Just trying different stuff since nothing is working...except adb shell USB console to twrp-3.2.1-0-falcon with only a teamwin logo.
Mon Feb 5 14:02:41 MST 2018 tried twrp-3.2.1-0-titan.img same results as above.
 
Last edited:

Rajvir8

Member
Mar 20, 2017
30
2
0
Hi I'm trying to get TWRP 3.2.1-0 Falcon work for my Moto G XT1032, but when I installed it I entered a bootloop where I just continually went back to TWRP 3.2.1-0

First I looked up how other people solved it, and several people managed to fix it by running

dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota into the terminal command box

I tried but all I got was that there was no space left on the device and it failed.

Luckily I was able to fix my phone by running a recovery and reverting my TWRP back to my TWRP 3.0.2-2

But I am now back to where I began, I have at least turned on ATB so I can try the other recovery method but does anyone know what happened?

If I try to flash it again will the same problem occur and if so should I try 3.1.1 Falcon or will the same problem occur?
 

schrickz

Senior Member
Nov 10, 2010
651
165
73
Ambon
www.syaischrickz.blogspot.com
Hi I'm trying to get TWRP 3.2.1-0 Falcon work for my Moto G XT1032, but when I installed it I entered a bootloop where I just continually went back to TWRP 3.2.1-0

First I looked up how other people solved it, and several people managed to fix it by running

dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota into the terminal command box

I tried but all I got was that there was no space left on the device and it failed.

Luckily I was able to fix my phone by running a recovery and reverting my TWRP back to my TWRP 3.0.2-2

But I am now back to where I began, I have at least turned on ATB so I can try the other recovery method but does anyone know what happened?

If I try to flash it again will the same problem occur and if so should I try 3.1.1 Falcon or will the same problem occur?
1st, this is a peregrine thread.
2nd, which method you've used to install the TWRP? Directly flashing the .img via TWRP always worked for me.
 

Rajvir8

Member
Mar 20, 2017
30
2
0
1st, this is a peregrine thread.
2nd, which method you've used to install the TWRP? Directly flashing the .img via TWRP always worked for me.
My apologizes, I'll try to find the falcon thread.

I directly flashed the image file.

It worked but then I was stuck in a bootloop where I kept going to the TWRP menu and couldn't get out no matter what I did.

Eventually I fixed it by recovering back to my old TWRP through recovery but naturally that put me back to where I was before.

I'll try flashing twrp-3.2.1-0-xt1032 instead of the Falcon I used as it's more specific to my device and might work where the other failed.
 
Last edited:
G

GuestK00247

Guest
twrp 3.3.0 is out now: https://eu.dl.twrp.me/peregrine/

* Merge AOSP 9.0 r3 (Dees_Troy)
* Use ANDROID_ROOT variable instead of hard coding to /system (CaptainThrowback)
* Decrypt FBE on 9.0 and metadata decrypt (Dees_Troy)
* vold decrypt updates (CaptainThrowback and nijel8)
* Support vibration on LED class devices (notsyncing)
* Metadata decrypt support for Pixel 3 (Dees_Troy)
* Support rotating the display via build flag (vladimiroltean)
* Reboot to EDL mode button (mauronofrio)
* Support MTP on FFS devices (bigbiff)
* Update FDE decrypt to support keymaster 3 and 4 (Dees_Troy)
* Detect mkfs.f2fs version to properly format on f2fs partitions (Dees_Troy)
* Allow TWRP to use md5 and sha256 checksums for zip installs (bigbiff)
* TWRP can use /data/cache/recovery and /persist/cache/recovery on AB devices with no cache partition (bigbiff)
* Switch part of advanced menus in TWRP to use a listbox of options (Dees_Troy)
* Use magiskboot to allow repacking boot images for installing TWRP (Dees_Troy with thanks to topjohnwu of course)
 

passtim

Senior Member
Sep 22, 2016
90
12
0
I have a peregrine now running (unofficial) lineageos 16. TWRP is installed, and could install files to 'system' if only it could read them from 'data'. The problem is decryption. TWRP 3.2.3 sees that it is encrypted, asks for a pin, but doesn't recognise the valid pin. 3.3.1 doesn't even ask for a pin. Before I moved from lineageos 14.1 (my own build so as to keep up with android security patches) TWRP 3.2.3 worked OK.

I have an SD card installed as 'internal' rather than 'portable', but TWRP can't see the files, so putting an install file on the SD card (downloaded to the mobile or via PC) doesn't help. Similarly I could do a backup if only there was somewhere to put it.

In the TWRP FAQ they imply that decryption may never work on some devices. The update list for 3.3.0 says it includes decryption for Android 9 but it doesn't work for me. Am I stuck with this situation? I guess I can install using ADB from my PC, butit's a lot less convenient. I'm really unsure whether I can backup at all.
 

passtim

Senior Member
Sep 22, 2016
90
12
0
I have a peregrine now running (unofficial) lineageos 16. TWRP is installed, and could install files to 'system' if only it could read them from 'data'. The problem is decryption. TWRP 3.2.3 sees that it is encrypted, asks for a pin, but doesn't recognise the valid pin. 3.3.1 doesn't even ask for a pin. Before I moved from lineageos 14.1 (my own build so as to keep up with android security patches) TWRP 3.2.3 worked OK.

I have an SD card installed as 'internal' rather than 'portable', but TWRP can't see the files, so putting an install file on the SD card (downloaded to the mobile or via PC) doesn't help. Similarly I could do a backup if only there was somewhere to put it.

In the TWRP FAQ they imply that decryption may never work on some devices. The update list for 3.3.0 says it includes decryption for Android 9 but it doesn't work for me. Am I stuck with this situation? I guess I can install using ADB from my PC, butit's a lot less convenient. I'm really unsure whether I can backup at all.
If my question is daft, please tell me. There's an awful lot I don't know or understand about an awful lot! If there are things I need to check about the android build I can root it and take a look.
 

_that

Recognized Developer / Recognized Contributor
Oct 2, 2012
4,817
4,205
243
If my question is daft, please tell me. There's an awful lot I don't know or understand about an awful lot! If there are things I need to check about the android build I can root it and take a look.
The first thing I'd check is /tmp/recovery.log after booting TWRP (use adb pull) and see if there's anything interesting related to decryption there. Maybe also look in the output of "adb shell dmesg".

Personally I have no experience with device-specific decryption issues, but if you're lucky, someone in #twrp can help you.
 

passtim

Senior Member
Sep 22, 2016
90
12
0
The first thing I'd check is /tmp/recovery.log after booting TWRP (use adb pull) and see if there's anything interesting related to decryption there. Maybe also look in the output of "adb shell dmesg".

Personally I have no experience with device-specific decryption issues, but if you're lucky, someone in #twrp can help you.
I attach a recover.log and dmesg. There are a lot of messages saying that it can't access the fsfs data partition, but I've no idea whether that's expected because it doesn't realise the system is encrypted, or what else might be the problem.

Any ideas?
 

Attachments

_that

Recognized Developer / Recognized Contributor
Oct 2, 2012
4,817
4,205
243
I attach a recover.log and dmesg. There are a lot of messages saying that it can't access the fsfs data partition, but I've no idea whether that's expected because it doesn't realise the system is encrypted, or what else might be the problem.

Any ideas?
The first thing that catches my eye is this:

Code:
E:Unexpected value for crypto key location
Could not mount /data and unable to find crypto footer.
That error message is from here:

https://github.com/omnirom/android_bootable_recovery/blob/android-9.0/crypto/fde/cryptfs.cpp#L797

Traditionally, the crypto metadata was stored in the footer (last 16k) of the /data partition - do you know if/how that has changed with your LineageOS 16?
 

passtim

Senior Member
Sep 22, 2016
90
12
0
The first thing that catches my eye is this:

Code:
E:Unexpected value for crypto key location
Could not mount /data and unable to find crypto footer.
That error message is from here:

https://github.com/omnirom/android_bootable_recovery/blob/android-9.0/crypto/fde/cryptfs.cpp#L797

Traditionally, the crypto metadata was stored in the footer (last 16k) of the /data partition - do you know if/how that has changed with your LineageOS 16?
I've no idea, and don't know how to find out where it is. Is there a way once booted up?
I do know that TWRP 3.2.3 did know it was encrypted, but didn't like the pin.