Custom recovery results in non-working N7 - Nexus 7 Q&A, Help & Troubleshooting

My N7 is unlocked, I upgraded to 4.2.2 factory stock, rooted, and flashed ClockworkMod Recovery 6.0.2.3 touch recovery. I ran into a very strange issue; if I flash the custom recovery on the tablet, then the tablet boots into a screen that asks me to type my password to decrypt storage not allowing me to enter the homescreen until I do so. Later, I found out that flashing back to stock recovery fixes the problem and my N7 is functional again. I've tried everything while on the custom recovery: erasing, formatting, writing userdata to the device without success.

I'm not really sure what question you are asking. Also, I think you might be leaving something out which ought to be clarified, the way you describe things seems to have some pieces missing. (And, you really should not be starting yet another thread on this)
You shouldn't be able to flash custom ROMs with a stock recovery; so, are you saying that you:
- flash a ROM with a custom recovery
- try and boot it -- but it fails with the "enter password" prompt (you mention "won't let me enter the homescreen")
- flash the stock recovery into place
- perform a factory reset with the stock recovery
- now the ROM boots?
Also, do you get the same result with TWRP?

bftb0 said:
I'm not really sure what question you are asking. Also, I think you might be leaving something out which ought to be clarified, the way you describe things seems to have some pieces missing. (And, you really should not be starting yet another thread on this)
You shouldn't be able to flash custom ROMs with a stock recovery; so, are you saying that you:
- flash a ROM with a custom recovery
- try and boot it -- but it fails with the "enter password" prompt (you mention "won't let me enter the homescreen")
- flash the stock recovery into place
- perform a factory reset with the stock recovery
- now the ROM boots?
Also, do you get the same result with TWRP?
Click to expand...
Click to collapse
It's a help/troubleshooting post. I know it wasn't good to start another thread, but I felt that people that had already browsed my thread the first time wouldn't come back and now I found the reason behind my issue. I didn't flash a custom rom with stock recovery; I used fastboot on my pc to issue commands. My phone has the factory stock rom on it - then if I flash clockworkmod recovery, the next time I reboot, there's a screen that says I need to type a password to decrypt storage and I'm not able to access anything. If I go back into the bootloader and erase and write the stock recovery, I'm able to boot into the homescreen without the issue. Everything I've flashed to the tablet is done through my pc via fastboot. I never tried TWRP, but I don't like that recovery anyways.

UnlockedNand said:
It's a help/troubleshooting post. I know it wasn't good to start another thread, but I felt that people that had already browsed my thread the first time wouldn't come back and now I found the reason behind my issue. I didn't flash a custom rom with stock recovery; I used fastboot on my pc to issue commands. My phone has the factory stock rom on it - then if I flash clockworkmod recovery, the next time I reboot, there's a screen that says I need to type a password to decrypt storage and I'm not able to access anything. If I go back into the bootloader and erase and write the stock recovery, I'm able to boot into the homescreen without the issue. Everything I've flashed to the tablet is done through my pc via fastboot. I never tried TWRP, but I don't like that recovery anyways.
Click to expand...
Click to collapse
OK, read and understood. Very bizzare, however. Almost sounds more like something caused by the bootloader (during the fastboot write) rather than it mattering which custom recovery is sitting there (it's not clear from the above, but it almost sounds like it is not even necessary to have ever booted the custom recovery from the device's recovery partition for the problem to appear)
Are you also saying that you can not flash a custom ROM from the custom recovery without this "enter password" phenomenon happening, or is it only this combo of pure stock ROM + recovery flashed via fastboot that exhibits the problem?
I have a lightly-rooted JDQ39 Stock (4.2.2) ROM with a custom recovery - no such troubles. But mine was installed by using factory-via-fastboot of 4.2.1, followed by a manually-triggered OTA to JDQ39, and then followed in turn by a fastboot flash of the recovery partition (TWRP 2.4.1.0). That last flash was certainly performed by the 4.18 bootloader.
No troubles, but that is certainly a different installation path.
Two more small questions for clarification purposes: when you installed the factory 4.2.2 ROM via fastboot, did you follow the exact sequence of the install-all.sh script:
Code:
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
fastboot flash bootloader bootloader-grouper-4.18.img
fastboot reboot-bootloader
sleep 10
fastboot -w update image-nakasi-jdq39.zip
... or did you omit anything (e.g. one or more of the erases, the bootloader flashing, etc)?

Yeah, it's like the bootloader writes bad information to the userdata partition if the recovery isn't stock. I haven't flashed a custom rom from the custom recovery, but I'm assuming the type your password issue would appear again. Yes, it's a combo of pure stock rom + custom recovery when this problem occurs. No, when I installed the 4.2.2 factory stock rom, I unzipped all the image files and typed these commands.
Code:
fastboot oem lock
fastboot oem unlock
fastboot flash bootloader <bootloader name>.img
fastboot flash boot <boot name>.img
fastboot flash system <system name>.img
fastboot flash userdata <userdata name>.img
fastboot reboot-bootloader
fastboot erase cache
fastboot reboot
I've also gone back and manually erased, formatted, and wrote the userdata partition again. Maybe I should try downgrading the bootloader to 4.2.1, reflash userdata, and flash the custom recovery?

UnlockedNand said:
Yeah, it's like the bootloader writes bad information to the userdata partition if the recovery isn't stock. I haven't flashed a custom rom from the custom recovery, but I'm assuming the type your password issue would appear again. Yes, it's a combo of pure stock rom + custom recovery when this problem occurs. No, when I installed the 4.2.2 factory stock rom, I unzipped all the image files and typed these commands.
Code:
fastboot oem lock
fastboot oem unlock
fastboot flash bootloader <bootloader name>.img
fastboot flash boot <boot name>.img
fastboot flash system <system name>.img
fastboot flash userdata <userdata name>.img
fastboot reboot-bootloader
fastboot erase cache
fastboot reboot
I've also gone back and manually erased, formatted, and wrote the userdata partition again. Maybe I should try downgrading the bootloader to 4.2.1, reflash userdata, and flash the custom recovery?
Click to expand...
Click to collapse
Hmmm. Well, I can't say for sure, but I am willing to gamble that the bootloader relocates itself into a load-offset address so that it runs out of RAM rather than running directly out of Flash Memory. Much quicker that way. The implication of that is that once it is fully loaded into RAM and operational, you could actually erase the bootloader and suffer no ill effects - until you powered off the device. Then you would be in real trouble.
The point is, in the Google factory sequence, all of the partition flashing is done by the new bootloader (4.18), whereas in your case none of it is done that way - except for the custom recovery flash. Here's the Google sequence:
- erase all partitions using currently installed bootloader (4.13)
- flash new bootloader and boot into it ( 4.13 -> 4.18 )
- flash all 4.2.2 ROM partitions using new bootloader
whereas your sequence looks like:
- (no explicit erasures)
- flash partitions with old bootloader (4.13)
- reboot into new bootloader ( 4.13 -> 4.18 )
- erase cache
- flash recovery with new bootloader ( 4.18 )
very different!
Also, the "-w" switch used in the google sequence causes partition erasure and re-formatting (depending on partition type) prior to each partition's flashing.
Without going through the lock/unlock procedure, I suppose it would be possible to reflash all the partitions with 4.18 to see if the problem disappears. But, now that I said that, I realize my tab - which had an OTA upgrade - is sort of similar in that the partitions & files patched by the OTA were all initially flashed by 4.13 (by me), patched by the OTA, and then finally I flashed only the custom recovery with the 4.18 bootloader.
Doing further experimentation might mean attempting a bootloader rollback flash. I can't say that I've seen reports here of anybody trying it. And I can't say I blame them - there could be dragons hiding in that process.

Ah, I see. The sequence I followed flashing the partitions would erase and write the partitions automatically done by the fastboot script. The only instance where I erased, formatted, and flashed the partition was the userdata when I was troubleshooting. From reading other threads before, I believe people have done bootloader rollbacks without consequences to the rest of the partitions. The bootloader updates contain fixes, but aren't explicitly required for the rom to run, am I correct?

Related

[Q] Possible Brick?

I'm selling my Nexus 7 and I think I got a little click happy while clearing it out.
I had reinstalled 4.3 and then for some reason I formatted the data. Got stuck in a boot loop.
When I try to install the image again I get the following:
Updating partition details...
E:error opening '/data/media'
E:error: no such file or directory
Any help would be appreciated!
"90% of the time, when someone says something's bricked, the only brick is their head." - Koush
All this means is that your userdata partition got all jacked up. It's restored when you boot into a rom, but of course you can't boot into a rom cause something else must have also went awry. So I suggest you wipe everything and start over. Follow along with me, this will be fun!
Boot into fastboot, send fastboot unlock command if your bootloader isn't already unlocked "fastboot oem unlock." Accept on screen. Reboot back into bootloader/fastboot. Issue FASTBOOT ERASE USERDATA, FASTBOOT ERASE RECOVERY, FASTBOOT ERASE CACHE, FASTBOOT ERASE SYSTEM. Then flash TWRP recovery using FASTBOOT FLASH RECOVERY [NAME OF TWRP GROUPER IMG]. Then adb push your rom and gapps back to your tablet using ADB PUSH [FILE] /SDCARD, then flash your rom and enjoy a fresh clean tablet!
That's why I prefixed with 'possible'...
Thanks - I followed this guide later in the evening and got it all up and going again.
http://goo.gl/BsiewY
0vermind said:
"90% of the time, when someone says something's bricked, the only brick is their head." - Koush
All this means is that your userdata partition got all jacked up. It's restored when you boot into a rom, but of course you can't boot into a rom cause something else must have also went awry. So I suggest you wipe everything and start over. Follow along with me, this will be fun!
Boot into fastboot, send fastboot unlock command if your bootloader isn't already unlocked "fastboot oem unlock." Accept on screen. Reboot back into bootloader/fastboot. Issue FASTBOOT ERASE USERDATA, FASTBOOT ERASE RECOVERY, FASTBOOT ERASE CACHE, FASTBOOT ERASE SYSTEM. Then flash TWRP recovery using FASTBOOT FLASH RECOVERY [NAME OF TWRP GROUPER IMG]. Then adb push your rom and gapps back to your tablet using ADB PUSH [FILE] /SDCARD, then flash your rom and enjoy a fresh clean tablet!
Click to expand...
Click to collapse

[Q] Stuck at boot animation after flashing 5.1

I was using 5.0.1, with stock bootloader, stock recovery, actually stock everything except SuperSU added.
I downloaded the 5.1 image from Google, and tried flashing it:
fastboot flash bootloader bootloader-mako-makoz30f.img
fastboot reboot-bootloader
fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1701.06.img
fastboot reboot-bootloader
fastboot update image-occam-lmy47o.zip
Got some missing sig errors, and "failed to allocate xxxxxxxxx bytes" error. Thus after searching for more information I ended up unpacking image-occam-lmy47o.zip and running:
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash cache cache.img
Then rebooted. The result is an endless boot animation, regardless of anything I try. Tried restoring my TWRP backup, reflashing 5.1, reflashing 5.0.1, always the same. Last logcat line at boot:
E/kickstart( 233): Sahara protocol completed
Then it's just stuck there. For minutes. For tens of minutes. Looks like forever. Anyone else ever seen this problem, and happens to have a solution? (Preferably without losing my data)
Edit: After a few hours I restored the original (or so I hope) state, by wiping, then flashing 5.0.1, then restoring my backup. But now I don't dare to try flashing 5.1 again. Still would love to hear ideas from who might have seen this problem and knows a solution.
After you've flashed the factory image boot into the stock recovery and do a factory reset.
Sent from my Nexus 9 using XDA Free mobile app
IVBela said:
I was using 5.0.1, with stock bootloader, stock recovery, actually stock everything except SuperSU added.
I downloaded the 5.1 image from Google, and tried flashing it:
fastboot flash bootloader bootloader-mako-makoz30f.img
fastboot reboot-bootloader
fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1701.06.img
fastboot reboot-bootloader
fastboot update image-occam-lmy47o.zip
Got some missing sig errors, and "failed to allocate xxxxxxxxx bytes" error. Thus after searching for more information I ended up unpacking image-occam-lmy47o.zip and running:
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash cache cache.img
Then rebooted. The result is an endless boot animation, regardless of anything I try. Tried restoring my TWRP backup, reflashing 5.1, reflashing 5.0.1, always the same. Last logcat line at boot:
E/kickstart( 233): Sahara protocol completed
Then it's just stuck there. For minutes. For tens of minutes. Looks like forever. Anyone else ever seen this problem, and happens to have a solution? (Preferably without losing my data)
Edit: After a few hours I restored the original (or so I hope) state, by wiping, then flashing 5.0.1, then restoring my backup. But now I don't dare to try flashing 5.1 again. Still would love to hear ideas from who might have seen this problem and knows a solution.
Click to expand...
Click to collapse
You only really need to flash the following (unless there is a new bootloader and radio):
fastboot flash boot boot.img
fastboot flash recovery recovery.img (if you are running custom recovery you can skip flashing this)
fastboot flash system system.img
metpage said:
You only really need to flash the following (unless there is a new bootloader and radio):
fastboot flash boot boot.img
fastboot flash recovery recovery.img (if you are running custom recovery you can skip flashing this)
fastboot flash system system.img
Click to expand...
Click to collapse
There was a new radio, but that worked (I accidentally booted normally after flashing it). The rest is the same that I did, except the cache, guess next time I'll try doing it without flashing that one. Do I not have to wipe the cache partition either? (And no custom recovery here, I boot TWRP from my PC via fastboot.)
Edit: Who understands this.... I tried it again tonight, flashed radio, then fastboot update image-occam-lmy47o.zip worked, no error this time, no unpacking, nothing. Just a successful update this time.
Guess that wipe was needed, maybe something was already corrupted before I tried flashing the first time.
Case closed.

A2017G How to relock Bootloader to original mode.

Hi,
is it possible to relock the bootloader to original factory mode.
fastboot oem lock (will erase userdata)
Also you should restore the fbop partition: /dev/block/bootdevice/by-name/fbop
For more reference see:
https://forum.xda-developers.com/axon-7/help/lock-unlocked-bootloader-t3444044
https://forum.xda-developers.com/showpost.php?p=68738854&postcount=100
Also please don't open a thread to a question that has already been answered several times.
After i unlocked bootloader my phone now is recognized as A2017U. When i relock it will it then recognized as original A2017G ?
I am interested in a tutorial about going back to stock for G model
The procedure for the g model is no different than the U model except you have to revert the bootloader (fbop partition) because the european model is quite restricted.
For making a tutorial I would need to know exactly what you modified.
There are already good step by step guides in this forum. All I could offer you are my backup files for the recovery and bootloader for the 2017G with update B08.
Bomberus said:
The procedure for the g model is no different than the U model except you have to revert the bootloader (fbop partition) because the european model is quite restricted.
For making a tutorial I would need to know exactly what you modified.
There are already good step by step guides in this forum. All I could offer you are my backup files for the recovery and bootloader for the 2017G with update B08.
Click to expand...
Click to collapse
At the moment i am on B09 rooted but I installed it via TWRP using DrakenFx's tutorial from here : https://forum.xda-developers.com/showpost.php?p=68873485&postcount=3
Futhermore when I unlocked the bootloader I was on B03 and I saved the aboot.img and fbop_lock.img .
Now I would like to go back to fully stock to prepare for the android N update.
I would highly appreciate it if you could offer me some directions for this matter.
Never tried this method (so I take no responsibility) but in order to receive ota you need an unmodified system with locked bootloader.
To lock your bootloader:
First backup all your apps, data and internal sdcard !
Connect your phone to a PC and start adb:
Type: "adb reboot bootloader"
Phone will restart: (if you are on linux, run fastboot with root permission)
Type: "fastboot oem device-info" (just to check things)
"fastboot oem lock" (will lock your bootloader)
According to DrakenFX you should have the stock recovery already installed. So you can flash a sd card upgrade from ZTE "http://www.ztedevice.com/support/detail?id=98CEB24F9FFD433EA99EC424163149A6" (to bring you back to stock)
If you still have TWRP use DrakenFX files to flash your system back to stock, but this time do not flash supersu.
You should be good to go and just have to wait for ZTE to release the update and apply it via the updater UI.
BTW this is my fastboot oem device-info output:
(bootloader) Device tampered: false
(bootloader) Device unlocked: true
(bootloader) Device critical unlocked: false
(bootloader) Charger screen enabled: true
(bootloader) Display panel:
OKAY [ 0.059s]
finished. total time: 0.059s
Click to expand...
Click to collapse
dodo34 said:
Hi,
is it possible to relock the bootloader to original factory mode.
Click to expand...
Click to collapse
You mind my asking the reason WHY you want to Relock?
If is cuz the N update , I'll rather keep it unlock base on @lokissmile thread and I'm 100% sure I'll be releasing N TWRP Flashable Zips for all variants when N is available.
i have G model and flashed the aboot of the U modell.
How to flash back now the aboot of the G modell back ?
Any help for the G modell ?
dodo34 said:
Any help for the G modell ?
Click to expand...
Click to collapse
as far my understanding the G model have factory images right? just download the one you were using and flash it using custom recovery.
LifeSupportZ said:
as far my understanding the G model have factory images right? just download the one you were using and flash it using custom recovery.
Click to expand...
Click to collapse
@dodo34
This is correct, the full image should be the one that contains both the emmc_appsboot.mbn (this is your aboot or bootloader partition) and the fastboot.img (the fbop or fastboot command partition) as well as recovery.img. This will set everything back to stock in one swoop. Otherwise you have to reflash the signed (tenfars) TWRP to flash back the fastboot image and then falsh back stock, since regular TWRP will either not be there anymore or will not run since BL is locked now
P.S, you can leave the fastboot alone for the purposes of OTA, no update so far hes checked on it and i am not sure if there is a G package with it since it has not changed from release, so as long as the image you flash has the bootloader and recover you should be good for N
P.S.2 Actually I see a little catch 22 here. If you lock the BL first, then you will not be able to run TWRP or boot into system if it was modified. You would need to flash the "signed" version of TWRP or flash stock recovery before locking the BL. Stock would be preferable since it can flash the factory package withouht modifications. If using TWRP i think you have to change updater-script to remove a .... and i just found another catch 22. The updater-script will look for product name P996A04 and if yours shows as 2017U the it will report back P996A01 so you will have to have a signed TWRP on there no matter what. Either to flash the backed up aboot fbop and recovery and then flash the full factory package through stock recovery or mod the updater-script and remove the assert line and flash the whole thing with TWRP. What do you get in TWRP shel when you run this "getprop ro.product.model"
peramikic said:
@dodo34
This is correct, the full image should be the one that contains both the emmc_appsboot.mbn (this is your aboot or bootloader partition) and the fastboot.img (the fbop or fastboot command partition) as well as recovery.img. This will set everything back to stock in one swoop. Otherwise you have to reflash the signed (tenfars) TWRP to flash back the fastboot image and then falsh back stock, since regular TWRP will either not be there anymore or will not run since BL is locked now
P.S, you can leave the fastboot alone for the purposes of OTA, no update so far hes checked on it and i am not sure if there is a G package with it since it has not changed from release, so as long as the image you flash has the bootloader and recover you should be good for N
P.S.2 Actually I see a little catch 22 here. If you lock the BL first, then you will not be able to run TWRP or boot into system if it was modified. You would need to flash the "signed" version of TWRP or flash stock recovery before locking the BL. Stock would be preferable since it can flash the factory package withouht modifications. If using TWRP i think you have to change updater-script to remove a .... and i just found another catch 22. The updater-script will look for product name P996A04 and if yours shows as 2017U the it will report back P996A01 so you will have to have a signed TWRP on there no matter what. Either to flash the backed up aboot fbop and recovery and then flash the full factory package through stock recovery or mod the updater-script and remove the assert line and flash the whole thing with TWRP. What do you get in TWRP shel when you run this "getprop ro.product.model"
Click to expand...
Click to collapse
if he mod the updater_script from official zte update to make it flash friendly, this is what i'll do,
* Mod updater script and remove aboot and recovery for now
* flash new zip without file mention above
* boot to bootloader while having custom recovery
* lock back the bootloader
* boot to custom recovery and perform " format data "
* create a flashable zip with stock aboot and recovery
* flash new zip with aboot and recovery
* reboot to recovery and check if boot to stock recovery and while in there perform a factory reset
i know is a lot of steps but, seems like is the way to go to get everything back in place without zte noticing anything.
Now i am on B06.
I put update.zip B08 and select update. But it boots to TWRP recovery and update fails.
@dodo34 If you are trying to restore from the OS system update you need to reflash your stock recovery for it to work properly. Wait for someone to confirm what I just said, but that's how it worked for me.
how can i flash my original recovery. what is the command for cmd ?
Please help restoring back original recovery.
dodo34 said:
Please help restoring back original recovery.
Click to expand...
Click to collapse
rczrider said:
Putting Your Axon 7 Back to Stock
If you want to revert back to stock and re-lock your bootloader (eg. sending the phone in for warranty work or are selling it), you should be able to do that using the steps below. It worked for me, anyway, exactly as written below.
Copy everything off your internal storage that you don't want to lose. If you're not rooted (so already stock, but with unlocked bootloader), skip to step 6 below. Otherwise, continue.
Grab the "StockSystem" zip for your variant from this thread and place on your microSD card: http://forum.xda-developers.com/axon-7/development/rom-guide-updates-to-stock-files-via-t3469484
Reboot into TWRP and wipe system, data, dalvik, and cache
Flash the StockSystem zip and power off (doing so will restore stock boot but does not appear to restore recovery)
Boot into EDL mode and flash stock recovery only: http://forum.xda-developers.com/axon-7/development/wip-axon-7-root-bootloader-unlokced-t3441204
Power off the phone, plug from computer, and then boot into stock recovery (hold Vol+ and press Pwr, continue holding Vol+ until recovery comes up)
Select "Wipe data / factory reset" and then "Yes"
After that finishes, select "Reboot to bootloader"
Plug in your phone into your computer and do: fastboot oem lock (see second post if this doesn't work and says <waiting for device>)
Your phone will reboot and should have been totally wiped (including internal storage) by doing the above
This should leave you with a stock, locked, and unrooted phone that can take OTAs. Note: it's possible (in fact, likely) that an OTA could break the ability to unlock your bootloader and gain root again, so be careful about going back to stock if you think you'll want to unlock/root later on!
If you need any stock files for B20 or B27 (stock recovery for re-locking, for example), you can get them here: http://forum.xda-developers.com/axon-7/development/untouched-b20-boot-recovery-files-t3443818
Click to expand...
Click to collapse
Try this guide from newbie unlock thread.
I get this error.
C:\Users\Intel\Downloads\Axon7\ADB>axon7tool -r
Usage:
axon7tool -r <boot|recovery|gpt> ...
axon7tool -w <boot|recovery>
C:\Users\Intel\Downloads\Axon7\ADB>axon7tool -r recovery
Connecting to device...
S: failed to read command
S: Failed to receive hello
terminate called after throwing an instance of 'std::runtime_error'
what(): error: Unknown error
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
what i did.
Flashed Draken TWRP System Image B06
Flashed Draken TWRP Stcok Recovery B06
Flashed full update.zip B08
Now my phone is recognized as A2017G on the PC
But when i reboot the phone i get a message that the phone is unlocked and not trusted ?
why ?

FYI: recovered G5 XT 1676 to stock and updated. :)

Just an FYI type thing that may save people a bit of digging around sometime.
I tried to get the update that just came out, but as i had TWRP as recovery, no good. Anyhow, in my trying i completely bollixed the phone. Would start, but always booted to TWRP and had various conniptions. Could not even get a TWRP backup to load. Strange not encountered before by me stuff............
Anyhow, recovered by the following method to stock and am back in business.
Boot into bootloader fastboot mode.
Extract .xml.zip format firmware file:
eg: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
to a folder on c drive of the PC that has the ADB and fastboot files in it.
In command prompt cd\ to that directory.
fastboot flash the following in sequence.
fastboot flash partition gpt.bin
fastboot flash motoboot motoboot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk1
fastboot flash system system.img_sparsechunk2
fastboot flash system system.img_sparsechunk3
fastboot flash system system.img_sparsechunk4
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
boots to stock .
Not my own work, adapted from this thread by t-bon3
https://forum.xda-developers.com/showthread.php?t=2542219
which I found thanks to eens post18 at this thread
https://forum.xda-developers.com/g5/how-to/npp25-137-33-stock-firmware-moto-g5-t3577084/page2
After this, Motorola system update installed. On Australian XT1676 is build number NPP25.137-15-7
Patch level 1-May-2017
Still get the I cant be trusted page on power up as have unlocked bootloader.
Many thanks to all at XDA, its a resource that can certainly get you into trouble, but then out of it again.
where do you get the stock firmware?
Think I worked out what I did wrong. Somehow, I changed the format of the data partition. Fat fingers at some point??
TWRP backups didn’t like that and would not mount or write to the data partition as it was not f2fs format that the backup had been made in??
Anyway, restored data from a TWRP backup after going to ....wipe…format data. All good.
That gave me the passcode lockout issue at next reboot which can deal with.
stock Firmware? http://www.filefactory.com/folder/c6cdedc45a775d27/?sort=created&order=DESC&show=25
for me stock the phone came with is: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
Worked on my XT1676 dual sim, but CHECK if its appropriate for your model. There are files on that page that wont be and flashing some of their components (particularly bootloader), can i have read, be unrecoverable disastrous. Be warned.
Slow, but got it. At first i thought it was corrupt as TWRP wouldn't flash it. My gumby. The .xml.zips apparently need to be extracted and flashed file by file.
We're you able to revert to a locked bootloader after this, I am looking forward to do so
We're you able to revert to a locked bootloader after this, I am looking forward to do so
Click to expand...
Click to collapse
didnt try, didnt need to for taking take the update.
And, from my reading there is no way so far to relock the bootloader. I got it to stock, with stock recovery, and that was enough for me.
astmacca said:
didnt try, didnt need to for taking take the update.
And, from my reading there is no way so far to relock the bootloader. I got it to stock, with stock recovery, and that was enough for me.
Click to expand...
Click to collapse
I can confirm what you said, but I am asking because I am sick of the warning before the device starts
ap4ss3rby said:
I can confirm what you said, but I am asking because I am sick of the warning before the device starts
Click to expand...
Click to collapse
You can get rid of that easily
Put phone in fastboot mode
Download logo from link below
Enter the following in a windows command prompt where you have fastboot files & the logo file
Code:
fastboot.exe flash logo logo-g5-fix.bin
http://drive.google.com/file/d/0B-idWfPYugGvREJaR3B0UFIxUkU/view?usp=sharing
TheFixItMan said:
You can get rid of that easily
Put phone in fastboot mode
Download logo from link below
Enter the following in a windows command prompt where you have fastboot files & the logo file
Code:
fastboot.exe flash logo logo-g5-fix.bin
http://drive.google.com/file/d/0B-idWfPYugGvREJaR3B0UFIxUkU/view?usp=sharing
Click to expand...
Click to collapse
Thanks, but this is why I made a Google pixel themed logo.bin and used a matching boot animation to go with it some time earlier
downgrade
thanks for the guide
- can i use this method to downgrade to this version?
- can i do this without unlocking the bootloader
- if it goes wrong can i unlock the bootloader later (i have an unlock code)
- is there a reason why we don't flash sparsechunk.0 ?
thanks in advance
distclean said:
thanks for the guide
- can i use this method to downgrade to this version?
- can i do this without unlocking the bootloader
- if it goes wrong can i unlock the bootloader later (i have an unlock code)
- is there a reason why we don't flash sparsechunk.0 ?
thanks in advance
Click to expand...
Click to collapse
No you cannot downgrade (same firmware version or newer required)
Yes - unlocked bootloader not required
As long as your phone still goes into the bootloader
You should flash all sparsechunks in number order
Thanks a bunch,
So to be absolutely clear, my phone shipped with NPP25.137-15-7 i can't install the stock rom linked, and the same version isn't out yet,
if i unlock the bootloader, would i be able to downgrade ?
Is the software channel setting preserved across this method?
distclean said:
Thanks a bunch,
So to be absolutely clear, my phone shipped with NPP25.137-15-7 i can't install the stock rom linked, and the same version isn't out yet,
if i unlock the bootloader, would i be able to downgrade ?
Is the software channel setting preserved across this method?
Click to expand...
Click to collapse
You maybe able to - there are different variants of the same phone
As long as the firmware is the same or newer (as in the bootloader and API version) it may flash
It will either flash or error out
There's only one way to find out - if your phone is dead anyway it's not going to make alot of difference
No - generally you can never downgrade firmware - doing so would be dangerous and you may loose the bootloader for good
thanks again,
motoboot.img is the bootloader you talk about? is the partition layout described somewhere? would custom roms use a different one here?
do tell me by the way if i should get this information elsewhere/if i should read something to get started in the whole moto g world.
distclean said:
thanks again,
motoboot.img is the bootloader you talk about? is the partition layout described somewhere? would custom roms use a different one here?
do tell me by the way if i should get this information elsewhere/if i should read something to get started in the whole moto g world.
Click to expand...
Click to collapse
You can write in adb
Code:
adb shell
cat /proc
cat /proc/partitions
Hello,
Does anyone know where can I download the latest firmware for Moto G5 XT1676 baseband Version: m8937_ 8000.122.02.40 R
Thanks
astmacca said:
Boot into bootloader fastboot mode.
Extract .xml.zip format firmware file:
eg: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
to a folder on c drive of the PC that has the ADB and fastboot files in it.
In command prompt cd\ to that directory.
fastboot flash the following in sequence.
fastboot flash partition gpt.bin
fastboot flash motoboot motoboot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk1
fastboot flash system system.img_sparsechunk2
fastboot flash system system.img_sparsechunk3
fastboot flash system system.img_sparsechunk4
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
boots to stock .
Click to expand...
Click to collapse
You're partially right. These commands won't work for our files. You have to flash the firmware according to the instructions contained within the "flashfile.xml" file within the archive. For example we have no "motoboot" partition
I've flashed every stock package available now (4 I think) and haven't been offered an update once. I've ran a couple of custom ROMs but they're just not right in one way or another. Might be time to move on.
distclean said:
Thanks a bunch,
So to be absolutely clear, my phone shipped with NPP25.137-15-7 i can't install the stock rom linked, and the same version isn't out yet,
if i unlock the bootloader, would i be able to downgrade ?
Is the software channel setting preserved across this method?
Click to expand...
Click to collapse
I upgraded to this and since then can't downgrade the phone to the stock roms available online. From memory trying to flash gpt.bin gave a "Security version downgrade" error. So I wouldn't assume you'll be able to downgrade and until there is a copy of this particular firmware, you won't be able to flash back or relock the bootloader
astmacca said:
Think I worked out what I did wrong. Somehow, I changed the format of the data partition. Fat fingers at some point??
TWRP backups didn’t like that and would not mount or write to the data partition as it was not f2fs format that the backup had been made in??
Anyway, restored data from a TWRP backup after going to ....wipe…format data. All good.
That gave me the passcode lockout issue at next reboot which can deal with.
stock Firmware? http://www.filefactory.com/folder/c6cdedc45a775d27/?sort=created&order=DESC&show=25
for me stock the phone came with is: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
Worked on my XT1676 dual sim, but CHECK if its appropriate for your model. There are files on that page that wont be and flashing some of their components (particularly bootloader), can i have read, be unrecoverable disastrous. Be warned.
Slow, but got it. At first i thought it was corrupt as TWRP wouldn't flash it. My gumby. The .xml.zips apparently need to be extracted and flashed file by file.
Click to expand...
Click to collapse
Is this ROM is good to my XT1676 Baseband: M8937_11.16.02.51R ?
astmacca said:
Think I worked out what I did wrong. Somehow, I changed the format of the data partition. Fat fingers at some point??
TWRP backups didn’t like that and would not mount or write to the data partition as it was not f2fs format that the backup had been made in??
Anyway, restored data from a TWRP backup after going to ....wipe…format data. All good.
That gave me the passcode lockout issue at next reboot which can deal with.
stock Firmware? http://www.filefactory.com/folder/c6cdedc45a775d27/?sort=created&order=DESC&show=25
for me stock the phone came with is: CEDRIC_NPP25.137-15_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
Worked on my XT1676 dual sim, but CHECK if its appropriate for your model. There are files on that page that wont be and flashing some of their components (particularly bootloader), can i have read, be unrecoverable disastrous. Be warned.
Slow, but got it. At first i thought it was corrupt as TWRP wouldn't flash it. My gumby. The .xml.zips apparently need to be extracted and flashed file by file.
Click to expand...
Click to collapse
Hi, i own the same model of moto g5, i do this in fastboot window
fastboot erase userdata
now the phone only boot in twrp and show a message "failed to mount /data". i think that delete my userdata partition, how could i fix it?
once i can avoid this loop in twrp, i follow these steps to flash stock rom
thanks in advance
juan

How to fix and clean your Pixel 2's partitions (should work for other devices too)

I wanted to make this post about my adventure with my old Pixel 2. I was getting non-stop red lines out of the log in TWRP. Many times I would have problems mounting system and vendor partitions as well as vendor partitions needing "to be cleaned".
This led me to believe that I may have a corrupted partition, so I did some research into how the partitions are organized, and what happens when you flash a lot of ROMs. Perhaps you want to go back to the stock firmware? Perhaps - like in my case - you want to install a ROM such as GrapheneOS that's meant to lock the bootloader afterwards, and act more like the stock ROM.
What I didn't understand up until recently is how exactly the A and B slots of phones like the Pixel 2 work. They work because the firmware allows updating OTA to the opposite slot of what's active. That way - in the worst case scenario - you can actually boot into the opposite slot and regain access to your phone. I'm not an expert on this, but that's my basic understanding.
So now that that's covered, another important aspect is flashing ROMs. If you are like me and like testing many different ROMs, you may end up running into issues such as the one I stated above with TWRP.
The only way I was able to avoid these types of issues is to run some commands through fastboot.
One such command is
Code:
fastboot format system
This command will format the system partition and make it easier to install ROMs without running into issues.
Another command is
Code:
fastboot format vendor
This command was very important in my case, because the vendor partition was actually unusable for my slot A. Doing this command finally fixed that issue.
Another thing to note is ROMs can be installed in both slots. A lot of people don't do this, because they leave their bootloader unlocked and probably just run the ROM for half a day, and flash another. In my case, I needed to flash both slots in order to lock the bootloader in GrapheneOS, and allow the OS to update OTA. If you don't flash both slots, that won't work.
Just to clarify further, these are the commands (at the bootloader) I ran (from a command prompt in Windows) in order from start to finish when I was flashing a ROM I wanted to keep:
Code:
fastboot --set-active=a
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot --set-active=b
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
// Let the phone reboot into the new ROM, let it sit for a minute,
// then reboot into bootloader manually and then continue with fastboot:
fastboot --set-active=a
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
Once I've done this, and can confirm it successfully loads into the ROM I've installed, I can now say that I have a clean, fresh install in BOTH slots A and B.
I'll update this thread if I can think of anything else that can help newbies like me.
Cheers!
HCFL said:
I wanted to make this post about my adventure with my old Pixel 2. I was getting non-stop red lines out of the log in TWRP. Many times I would have problems mounting system and vendor partitions as well as vendor partitions needing "to be cleaned".
This led me to believe that I may have a corrupted partition, so I did some research into how the partitions are organized, and what happens when you flash a lot of ROMs. Perhaps you want to go back to the stock firmware? Perhaps - like in my case - you want to install a ROM such as GrapheneOS that's meant to lock the bootloader afterwards, and act more like the stock ROM.
What I didn't understand up until recently is how exactly the A and B slots of phones like the Pixel 2 work. They work because the firmware allows updating OTA to the opposite slot of what's active. That way - in the worst case scenario - you can actually boot into the opposite slot and regain access to your phone. I'm not an expert on this, but that's my basic understanding.
So now that that's covered, another important aspect is flashing ROMs. If you are like me and like testing many different ROMs, you may end up running into issues such as the one I stated above with TWRP.
The only way I was able to avoid these types of issues is to run some commands through fastboot.
One such command is
Code:
fastboot format system
This command will format the system partition and make it easier to install ROMs without running into issues.
Another command is
Code:
fastboot format vendor
This command was very important in my case, because the vendor partition was actually unusable for my slot A. Doing this command finally fixed that issue.
Another thing to note is ROMs can be installed in both slots. A lot of people don't do this, because they leave their bootloader unlocked and probably just run the ROM for half a day, and flash another. In my case, I needed to flash both slots in order to lock the bootloader in GrapheneOS, and allow the OS to update OTA. If you don't flash both slots, that won't work.
Just to clarify further, these are the commands (at the bootloader) I ran (from a command prompt in Windows) in order from start to finish when I was flashing a ROM I wanted to keep:
Code:
fastboot --set-active=a
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot --set-active=b
fastboot format system
fastboot format vendor
fastboot reboot bootloader
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
// Let the phone reboot into the new ROM, let it sit for a minute,
// then reboot into bootloader manually and then continue with fastboot:
fastboot --set-active=a
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
fastboot update rom.zip
Once I've done this, and can confirm it successfully loads into the ROM I've installed, I can now say that I have a clean, fresh install in BOTH slots A and B.
I'll update this thread if I can think of anything else that can help newbies like me.
Cheers!
Click to expand...
Click to collapse
Would this help in bootloop as well? I have a pixel 1st gen that does. I have flashed and or tried to anyways factory images...OTA and even was able to boot twrp and get lineage to flash, only to get a random reboot and bootloop. I would need to flash the factory image in order to get this phone operable. Should I flash a factory image and then do your steps or should I do the steps first and then flash the factory image?
Nope. Did not work. Seems as if the stock recovery is fubar

Categories

Resources