Returning to Stock from CM 13 - Moto X Q&A

Hi guys,
I am planning to return to Stock 5.1 on my phone, after running CM 13.
So I upgraded from 4.4 to 5.1 my manually flashing the zip in recover.(XT1053_GHOST_TMO-RETAIL_5.1_LPA23.12-15.5_cid9_CFC.xml.zip would be the file from https://firmware.center/firmware/Motorola/Moto X (1st gen-2013)/Stock/XT1053 T-Mobile/)
From there I moved on to CM 12 and then CM 13.
Device version is XT1053.
Been facing issues with bluetooth devices and planning to get back to stock 5.1
So I tried manually(mfastboot) flashing components (boot, recovery and system). Boot and recovery went fine, but system gave me(similar) error.
load_file: could not allocate 829072920 bytes
error: cannot load 'system.img': Not enough space
Referred to this tutorial, http://forum.xda-developers.com/moto-x/general/guide-moto-x-return-to-100-stock-using-t2446515
and tried the manually method wherein I ran these 2 commands :
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
Threw some error(forgot to note them down) :|
Anyway, nothing work post that.
Tried rebooting, got the "no command" screen.
Eventually flashed TWRP and installed CM13 again from zip and got the phone booted up.
Running fine, but still can't to get back to stock!
Tried RSDLite method from the tutorial above, but RSD doesn't detect my phone on connecting.
adb devices command does list the phone.
Can someone please point me in the right direction ?
btw, noticed something weird after failed partition flash.
Whenever I mfastboot recovery/boot it throws an error unknown command 'recovery' (or boot), but flashes fine.
Is this normal ?
Regards,
Neel Indap

Related

[Q] Help! Moto G Dead and massive headache

Right.
So, I was opening youtube on the last version of CM 12.1. No xposed, stock kernel, XT1068 model, when all of a sudden the phone stopped working.
Youtube wasn't opening. The phone was stuck on the home screen, all I could do was just press the home/back/recent buttons. Even long pressing power button to reboot would just take me to the power menu but Wouldn't allow me to do anything.
So in the end I long pressed the power menu to force reboot the phone aaaand... stuck on the boot logo. Not on the bootanimation, on the Motorola Bootlogo.
Managed to get to fastboot mode, tried to go to recovery, but after the twrp splash screen It would reboot to the splash screen again.
So i decided to mfastboot the original firmware. Who knows? maybe something got corrupted on cm.
Now, mfastboot is giving me weird errors.
flash partition gpt.bin gives (bootloader) Preflash validation failed
flash motoboot motoboot.bin gives FAILED (data transfer failure (Unknown error))
flash boot boot.img freezes everything and i need to reboot it to try and get to fastboot again.
Anybody knows what I should do? I'm kinda desperate here...
Thanks in advance. Peace.
(by the way, latest motorola drivers, just so you know...)
EDIT. Also, on the phone, it says
"hab check failed for primary_gpt
Failed to verify hab image primary_gpt"
Hope I can help
Are you flashing a gpt.bin from a previous android version? You cannot downgrade gpt.bin or motoboot.bin so the error is normal. From what firmware version is the boot.img you are flashing from? Try downloading this twrp recovery img from here https://dl.twrp.me/titan and
Code:
fastboot flash recovery recovery.img
or
Code:
mfastboot flash recovery recovery.img
Then you can try flashing any rom like this AOSP one http://forum.xda-developers.com/moto-g-2014/development/rom-android-source-project-t3123109
Hope this helps. I understand how hard it is to have a phone that won't boot.
Maybe you should try to place the stock rom 4.4.4 and then upgrade to 5.0, with 4.4.4 rom the GPT will have a downgrade and then you update the GPT putting 5.0
LudwigFerdinand18 said:
Maybe you should try to place the stock rom 4.4.4 and then upgrade to 5.0, with 4.4.4 rom the GPT will have a downgrade and then you update the GPT putting 5.0
Click to expand...
Click to collapse
You cannot downgrade gpt
Well I somehow managed to reboot into recovery, but the great problem here is that it won't mount \data.
Now, maybe all I need is to reformat \data cause it got corrupted, but since TWRP won't mount it, I can't do much about it.
I found on another thread this command
adb shell
killall -19 recovery
make_ext4fs /dev/block/mmcblk0p8
reboot
Which apparently formats the data partition of a phone. I suppose I'd have to change "ext4fs" into "f2fs", but I'm too scared to actually try it out.
Also because I don't know whether mmcblk0p8 is the right block for our data partition.
Jeez, I hate this.
Thanks for your help guys, but I don't think flashing recovery again would help. Nor downgrading, but I'll think about it.
EDIT.
Magic, just magic. After hours of tinkering I did EXACTLY THE SAME THINGS and now it's working. Restored the stock Rom and I'm off to install CM again.
Sorry guys and thanks so much!!!

Trying to ROOT my MotoG on Marshmallow

Hi to all, I had some problems with the battery life on my MotoG (2nd gen) running Lollipop and after a few tries I decided to wipe anything and flash the stock Marshmallow image.
First, I downloaded this image
XT1068_TITAN_RETAILDSDS_6.0_MPB24.65-34_cid7_CFC.xml.zip
and flashed correctly, step by step, as wrote here:
http://forum.xda-developers.com/showthread.php?t=2542219
I also downloaded this "Universal MotoG Toolkit" from here:
http://forum.xda-developers.com/moto-g-2014/development/ultimate-moto-g-2014-toolkit-t2979862
But it doesn't work as it should.
For example, if I connect the device and say to "Rebbot to Recovery from Phone" the Phone just reboot, not in recovery.
Also I found out that a new "Warnning bootloader unlocked" screen appears now, on startup.
Then, I tried to flash TWRP into recovery to Root my device but it keeps going on error "Mismatched partition size", any TWRP I try to flash (2.8.6.0,3.0.0.1).
Also, after this error, If I try to "normal powerup" from Fastboot, I have another error "UTAG flashfile configured as fastboot" so no normal powerup.
What I have to do to power up is flash again motoboot with this command:
fastboot flash motoboot motoboot.img
andf then
fastboot restart
And so, the phone restarts normally.
What's wrong with this?
Well this was happening to me and then instead of going for fastboot restart,, i gone to recovery and then its done ...
How go to recovery?

Soft bricked XT1052

Soft bricked when trying to flash stock 5.1 back from CM13. Somehow managed to wipe the entire phone and now all I have access to are fastboot and TWRP recovery. I have no ROM ZIPs to access in TWRP since internal storage was wiped. I tried ADB sideload but says it can't mount /data/. My computer recognises the phone as a fastboot device but not as an ADB device.
Is there any coming back from this?
I've downloaded the retail GB stock image file for XT1052 but I can't flash the partition as I just get error 'update gpt_main version failed' 'preflash validation failed for GPT'
Flash stock via mfastboot.
Try this link http://mark.cdmaforums.com/MotoX-ReturnToStock.html.
Proceed to option 5.
Sent from my XT1060 Dev Ed
varunpilankar said:
Flash stock via mfastboot.
Try this link http://mark.cdmaforums.com/MotoX-ReturnToStock.html.
Proceed to option 5.
Sent from my XT1060 Dev Ed
Click to expand...
Click to collapse
I've downloaded the RetGB for 5.1 for XT1052 from here: https://firmware.center/firmware/Motorola/Moto X (1st gen-2013)/Stock/XT1052/
But it seems to be missing a number of key files that are described in option 5 of the link you posted. Am I missing something? I'm also still getting errors each time I try to flash the partition except now CMD is just showing:
"target max-download-size: 768MB error: cannot load 'gpt.bin': no error. Any ideas? Thanks.
My only other thought at this point is to try and flash a ROM in recovery using USB-OTG. Could that work? For example, if I download stock ROM or even the CM 14 I had on previously before everything got wiped and put that on an external drive and flashed in TWRP?
varunpilankar said:
Flash stock via mfastboot.
Try this link http://mark.cdmaforums.com/MotoX-ReturnToStock.html.
Proceed to option 5.
Sent from my XT1060 Dev Ed
Click to expand...
Click to collapse
I just moved cmd.exe into my platform tools folder where everything else is and tried again to flash the partition. Instead this time I get:
C:\Android-SDK\platform-tools>mfastboot flash partition gpt.bin
(bootloader) Variable not supported!
target max-download-size: 768MB
sending 'partition' (32 KB)...
OKAY [ 0.335s]
writing 'partition'...
FAILED (remote failure)
finished. total time: 1.328s
And then on the phone itself in the fastboot screen it shows:
"downgraded security version. update gpt_main version failed. preflash verification failed for GPT'. I thought this would mean the bootloader I'm trying to flash would represent a downgrade but I checked against the info.txt file in the recovery image zip and it says 30.BE which matches the 30.BE in my fastboot screen...
OK I've now got an OS. Managed to reinstall CM14 using usb-otg. Figured that was the safest bet given it was the last OS installed.
Problem I now have is that I can't get any service (I could previously on CM14 before all this happened). Is it possible that when I managed to completely wipe the phone that I would the relevant modem/radio files?
Thanks
Try downloading stock file from
https://motorola-global-portal.custhelp.com/app/standalone/bootloader/recovery-images
fastboot method is mentioned in the above link.
Replace fastboot by mfastboot with all its necessary components in place.
Sent from my XT1060 Dev Ed
varunpilankar said:
Try downloading stock file from
https://motorola-global-portal.custhelp.com/app/standalone/bootloader/recovery-images
fastboot method is mentioned in the above link.
Replace fastboot by mfastboot with all its necessary components in place.
Click to expand...
Click to collapse
That doesn't have my version - xt1052.
Would this be to return my mobile service? I've got back on CM14 but all my IMEI and sim data has wiped so I can't get service. Not sure if I need to use the 5.1 factory image I have and just flash modem files. Seen elsewhere that I could try
Fastboot flash modem NON-hlos.bin
Fastboot erase modemst1
Fastboot erase modemst2
Fastboot flash fsg fsg.mbn
Would that do the trick do you reckon?
Take a nandroid backup & try doing it!
There is also a 5.1 stock zip Rom & try that too, might be helpful.
Sent from my XT1060 Dev Ed
Hi,
You'll eventually find your way back to 5.1 or even 4.4.4. I've broken just about every rule while I was doing some dev work on a moto x 2013 and from a beta of cm14, managed to pretty quickly get all the way back to 4.4.4 (which for me, is by far the best for a) battery and b) motion detection and c) everything works).
There was nothing after 5.1 for 2013, so there's no way you couldn't at least go back to 5.1, but there's always one way that works for you better than the rest. If that last thing didn't work, then try "liveroy's" way as in here: http://forum.xda-developers.com/moto-x/moto-x-qa/guide-faq-how-to-downgrade-5-1-to-4-4-4-t3182118 .. That way was actually based on an xt1052. I doubt if the radio files are going to make much difference heading in that direction, but are worth a shot before doing this.
I followed the first post in there and was un-"bricked" in ~20 minutes or so. Cheers // good luck,
hachamacha said:
Hi,
You'll eventually find your way back to 5.1 or even 4.4.4. I've broken just about every rule while I was doing some dev work on a moto x 2013 and from a beta of cm14, managed to pretty quickly get all the way back to 4.4.4 (which for me, is by far the best for a) battery and b) motion detection and c) everything works).
There was nothing after 5.1 for 2013, so there's no way you couldn't at least go back to 5.1, but there's always one way that works for you better than the rest. If that last thing didn't work, then try "liveroy's" way as in here: http://forum.xda-developers.com/moto-x/moto-x-qa/guide-faq-how-to-downgrade-5-1-to-4-4-4-t3182118 .. That way was actually based on an xt1052. I doubt if the radio files are going to make much difference heading in that direction, but are worth a shot before doing this.
I followed the first post in there and was un-"bricked" in ~20 minutes or so. Cheers // good luck,
Click to expand...
Click to collapse
Thanks. Will give that a look as I would like to know how to easily go back to stock in the event of catastrophe - I've been trying to flash back using both fastboot and TWRP but it fails every time due to 'downgrade security' etc. even though I know I'm using the same bootloader as in the stock ROM.
I managed to get my IMEI and service back by flashing
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot reboot
I've now got Resurrection Remix on as I thought I'd see if that would fix my service issues (it didn't - so still had to do the steps above). But have managed to learn a lot over the past few days to bring my phone back from death! I'm mainly used to Sony phones so this has been an experience.

Having trouble with restoring a soft-bricked XT1068

Hi there,
a friend asked me for help with restoring his german Moto G 2014 (XT1068). The last working software on the device was the Marshmallow update. He was having software issues and softbricked the device when trying to install a custom ROM.
Fastboot mode and stock recovery is accesible, the bootloader is unlocked and the device is stuck on the "WARNING: BOOTLOADER UNLOCKED" screen when trying to boot normally.
I have tried following this guide to revert the phone back to stock firmware with a matching system image. Both the XT1068_TITAN_RETDE_6.0_MPB24.65-34-3_cid7_CFC and XT1068_TITAN_RETAILDSDS_6.0_MPB24.65-34-3_cid7_CFC images will flash without any error messages. However, the device does not boot the new software. Also, when trying to relock the bootloader, the mfastboot oem lock command failes with the error message Not supported command in current status!. I tried to substitute mfastboot with fastboot, changed USB cables and downloaded new copies the images, with no success.
Digging deeper, I found out that I could not wipe cache or data using the stock recovery. This will fail with the error message blkdiscard on partition /dev/block/platform/msm_sdcc.1/by-name/cache failed. Further troubleshooting attempts lead me to try twrp custom recovery software (Version 3.1.1) which I could only start using the mfastboot boot twrp-3.1.1-0-titan.img command since flashing the image as custom recovery will not fail but the phone instantly and silently reverts to stock recovery - even when not rebooting inbetween. Consequently, any attempts to flash an image using the software will fail with E1001: Failed to update system image.
At this point, I have no idea what else I could try. That's why I turn to you, great community of XDA .
Any help would be greatly appreciated.

Solved with Corrections: Unable to flash TWRP, Failed (Remote: command not allowed)

Hi,
I just purchased a used Xperia Z1 C6903 and I am trying to put the latest Nougat Resurrection Remix on it. I need to get TWRP going first which I got stuck at trying to flash it.
I was able to get the phone downgraded to 14.1.G.1.534 using flash tool (ver 0.9.24.3). I did this following the guide here https://forum.xda-developers.com/showthread.php?t=2439328.
I was able to root it using Kingoroot.
I was able to unlock the bootloader using flashtool. Using *#*#7378423#*#*, the phone now reports Bootloader Unlocked: yes. See attached screenshot.
The part that I got stuck at is trying to flash TWRP in Fastboot. The command lines and error are below. The main error being "FAILED (remote: Command not allowed)"
I don't have an option in developer's options to "Unlock OEM bootloader". I read some other Xperia users being able to fix this problem by checking this.
I am running Windows 8.1. I am relatively sure that my drivers are correct. I had gotten a "drivers too old" error before in Flashtools but I was able to correct it by reinstalling new drivers.
I tried having debugging checked and unchecked before going into Fastboot and made no difference.
Tried both twrp-2.8.7.0-honami and twrp-3.0.2.0-honami with no success. Tried shortening file name to trp.img with no success.
Tried different 2 different adb files around the web with no success.
I read somewhere someone mentioned briefly that TWRP can be flashed using Flashtools. Is that true? I wasn't able to find a full guide for it.
Any help would be appreciated!
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery trp.img
target didn't report max-download-size
sending 'recovery' (13672 KB)...
OKAY [ 0.433s]
writing 'recovery'...
FAILED (remote: Command not allowed)
finished. total time: 0.439s
Well I was able to get TWRP on there by installing the XY Dual Recovery. The problem with it is that the Resurrection Remix's installation instruction says to use TWRP 3x or higher. TWRP on XY is only at 2.8.7.0. I couldn't find a TWRP 3x flashable zip file for Honami and TWRP wouldn't flash TWRP 3x IMG file I found. Fastboot is still giving me the same Command Not Allowed error.
Any ways, I went ahead and flashed RR with 2.8.7.0. When I tried to flash GAPPs after it says there is insufficient space. I have at least 9GB+ internal storage. So not sure what the deal is there.
I also lost Dual Recovery and root after first RR boot.
Looking into getting re-rooted and reinstalling XY Dual Recovery now.. And then flashing GAPPS after.
Anyone know what the consequences are for installing RR with a lower rev of TWRP?
So the RR Rom does have root but it just doesn't have apps root. Only ADB root. I cant flash the su add on from Lineage's site since I lost recovery. I ended up FTF back to stock and then reflashed everything, the ROM then pico version of GAPPs (pico worked) and then the su addon. The su addon had an error when flashing in TWRP.
Any ways, long story short the whole thing didn't work. Still stuck with RR Without recovery. Su addon didnt work from the flash. And for whatever reason my SIM is not detected and I lost my IMEI in RR. I read that this is a known issue with C6902 but I have the C6903 and I had confirmed this through the service menu before ROM flash. Maybe problems with flashing RR without the latest TWRP.
The Command Not Allowed is still an issue that I dont know how to resolve. So I still can't flash newer version of TWRP.
Any help would be appreciated....
I guess I will try to find a ROM that 's compatible with TWRP 2.8.7.0.
OK! I figured out what the Command Not Allowed problem is!
I've been following the flash guides from a few websites. And they all reference this syntax for flashing TWRP.
Fastboot flash recovery twrp.img.
This syntax didn't work for me. All those websites properly copycat each other.
That syntax is either incorrect or just didnt work for my setup for some reason. I kept searching for ways to flash TWRP and found another website that uses a different syntax. I gave it a go and TWRP flashed right away. This is the syntax that worked for me.
Fastboot flash boot twrp.img
At least that part of the problem is resolved.
Even after flashing RR with TWRP 3.0.20, the SIM/IMEI is still not showing. Recovery is still lost on first boot. Reinstalling TWRP on top of RR causes RR to not boot any more. I will have to look into the RR thread to investigate more.
I will mark this thread as Solved for the Command Not Allowed.
Crossed out everything cause that was not the correct solution. Striked them out to keep them as part of the troubleshooting steps history.
Oops duplicated post.
OK! So it looks like I have to correct myself here on my previous solution.
My solution from earlier for using "Fastboot flash boot twrp.img" is incorrect apparently. Don't use this!
That was the reason why my TWRP was lost after RR boot. The recovery partition comes after the boot and system partition. By flashing the recovery into boot, it screws up the order.
Nevertheless, the Command Not Allowed was still a problem if I tried to use "Fastboot flash recovery twrp.img"
Any ways I was still looking into this problem and started looking into the boot.img stuff and saw someone uses this command line: "fastboot erase boot". This helps someone being able to flash a boot.img when the user was having the Command not Allowed problem trying to flash a different img for the boot partition.
This gave me an idea to try and use "fastboot erase recovery".
I gave it a try and I was able to use "fastboot flash recovery twrp.img" afterwards! It was done in a second.
Then I went through the normal steps of flashing RR and TWRP stayed this time. So now all is good with everything!
Any ways to recap, my full steps used for my RR Installation:
1. Flashtool to flash an Android 5.1.1 stock rom. I used C6903_14.6.A.1.236_1276. (obtained through Flashtool, Xperifirm) Your phone has to run in 5.1.1 for the SIM and IMEI to work in RR. Don't need to flash modem.zip, that's for C6902 only.
2. Fastboot flash erase recovery
3. Fastboot flash recovery twrp.img
4. Follow instructions to flash RR normally.
5. Resize system partition size (for flashing GAPPS micro size or larger).
6. Flash GAPPS.
7. Flash su addon from Lineage's website to allow root for apps and ADB.
I hope this helps someone with similar problems in the future. Thanks to those who stop in to see me ramble to myself about silly stuff
I had the same error message and was able to successfully flash using the phone and the Android Studio Emulator app.
I was already rooted and had an unlocked bootloader.
I tried this solution and it said error: cannot "recovery": No such file or directory LOL even though it's right here and I use it all the time..........I just can't figure it out.

Categories

Resources