[Solved] Error after restoring to stock TWRP backup and reboot - Android Q&A, Help & Troubleshooting

hello folks,
I was on Android 7.0 on my Moto G 4.
I unlocked the bootloader, installed TWRP and flashed Android 7.1.2 and then 8.0 a week later.
Had backed up the stock Android 7.0 and the 7.1.2 also before i went to 8.0.
Today i restored the system back to the Stock version backup (7.0) and rebooted it.
Everything went fine. Then there was the notification of the Android security update. I proceeded with the install and it started rebooting.
In the reboot it stuck with the error message for bootlocker being unlocked and came back to TWRP. Even after going to reboot it only came back to TWRP. I then tried logged into the bootloader and tried to relock the bootloader using the commands (i was using mfastboot)
mfastboot oem lock
mfastboot flashing lock
mfastboot oem relock
it showed me an error for the 'relock' that it was an invalid command. Later i found that the unlock key also needs to be supplied (not sure). Then i tried the commands again after installing fastboot, and from the stock firmware folder.
fastboot oem lock begin
fastboot oem lock begin
fastboot flash partition gpt.bin
it showed me an error on this l9ast command saying invalid boot mode.
Any advise on how to start the relock process cleanly? my worry is if the system is bricked !
I was missing the stock moto so i need to go back there, all the flashing didn't seem too worthwhile.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Solution is in mentions by echo92 in the post by tywinlannister7 below
https://forum.xda-developers.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138

anoopgkris said:
hello folks,
I was on Android 7.0 on my Moto G 4.
I unlocked the bootloader, installed TWRP and flashed Android 7.1.2 and then 8.0 a week later.
Had backed up the stock Android 7.0 and the 7.1.2 also before i went to 8.0.
Today i restored the system back to the Stock version backup (7.0) and rebooted it.
Everything went fine. Then there was the notification of the Android security update. I proceeded with the install and it started rebooting.
In the reboot it stuck with the error message for bootlocker being unlocked and came back to TWRP. Even after going to reboot it only came back to TWRP. I then tried logged into the bootloader and tried to relock the bootloader using the commands (i was using mfastboot)
mfastboot oem lock
mfastboot flashing lock
mfastboot oem relock
it showed me an error for the 'relock' that it was an invalid command. Later i found that the unlock key also needs to be supplied (not sure). Then i tried the commands again after installing fastboot, and from the stock firmware folder.
fastboot oem lock begin
fastboot oem lock begin
fastboot flash partition gpt.bin
it showed me an error on this last command saying invalid boot mode.
Any advise on how to start the relock process cleanly? my worry is if the system is bricked !
I was missing the stock moto so i need to go back there, all the flashing didn't seem too worthwhile.
Click to expand...
Click to collapse
I'm not sure about this. As far as I know you can only relock the bootloader after a full (fastboot) wipe and install of the latest stockrom.
In the (far) past I managed to relock the bootloader of my Moto G 2014. Only after trial and error and only after a full flash. A week or so later I unlocked again....
I never relocked my Moto G4 Plus, nor my Moto G5 Plus. Simply because I don't see the need. The times that Motorola provides us with regular stock updates are, apparantly, over....

Thanks, Harro.
I thought that my TWRP would restore it back to stock. I read some half information about relocking and went ahead with the commands.
I also don't know if the USB debug settings are on.
It's shows a preflash verification error on the partition gpt.bin command. Think it's because maybe the stock version i downloaded is a downgrade. Can't find the exact stock for my LATAM dds_cust one. Another G4(Plus) version that was successful for others didn't work too.
Tried to skip and load boot partition but it said invalid boot state.
Need to keep trying different things. At least the bootloader and TWRP recovery are accessible for now.
Regards.

anoopgkris said:
Thanks, Harro.
I thought that my TWRP would restore it back to stock. I read some half information about relocking and went ahead with the commands.
I also don't know if the USB debug settings are on.
It's shows a preflash verification error on the partition gpt.bin command. Think it's because maybe the stock version i downloaded is a downgrade. Can't find the exact stock for my LATAM dds_cust one. Another G4(Plus) version that was successful for others didn't work too.
Tried to skip and load boot partition but it said invalid boot state.
Need to keep trying different things. At least the bootloader and TWRP recovery are accessible for now.
Regards.
Click to expand...
Click to collapse
Hi Anoop!
Yes, you'll have find the latest stockrom for your region. Also, a locked bootloader and TWRP is, in my humble opinion, a impossible combination. You'll have to fastboot install the whole rom, including (stock)recovery and the bootloader. And indeed: it's impossible to downgrade the bootloader: trying that will possibly result in a hardbrick...

Thank you, thank you for jumping in to always help.
Really sad that Moto also goes the way of not providing updates that too on a not so old phone. ROMs and the beautiful world of XDA is there, hopefully.

Related

bricked Moto E 2015

I tried to install android 6.0 XT1521 without unlocking the bootloader, and as it was an official rom motorola believed that would be possible. However it did not work and since I have not unlocked the bootloader, I can not go back to the retail XT1523 stock ROM
I was able to flash gpt.bin and bootloader.img, but things went south on boot.img. Now the bootloader is stuck with the following error:
Code:
version downgraded for boot
failed to validate boot image
Trying to flash boot.img (or system) fails with error:
Code:
hab check failed for boot
Failed to verify hab image boot
Trying to go back to XT1523 ROM fails with:
Code:
version downgraded for aboot
Trying to unlock the bootloader fails with:
Code:
Enable OEM Unlock
Which is obvious because I haven't enabled it on the phone, but it sucks because I can't boot and enable it.
So, here goes my questions:
- What does the "hab check failed" means? Is there any way to bypass it and finish flashing the XT1521 ROM?
- Is there any way to unlock the bootloader without enabling it first on developer settings?
- Is there anything I can do other than waiting that 6.0 gets rolled to XT1523 phones, and that a stock ROM for it gets leaked?
Thanks a lot for your kindly help!

Nexus 5x stuck in bootloop without usb debugging (stockrom NBD90W)

Hi there,
I would really appreciate any help at all. My device is stuck in bootloop but its adb and fastboot work properly. USB debugging is off and bootloader is locked.
What I have already tried:
1 - to flash any rom through fastboot: impossible, bootloader is locked
2 - to adb sideload an older rom OTA: no rom will be accepted, since NBD90W is the last one and you can't downgrade this way
3 - to adb sideload current rom OTA: works just fine, only thing I could do so far, but the phone remains in bootloop
4 - install a custom recovery through fastboot image.img: impossible, bootloader is locked
ipaulino84 said:
Hi there,
I would really appreciate any help at all. My device is stuck in bootloop but its adb and fastboot work properly. USB debugging is off and bootloader is locked.
What I have already tried:
1 - to flash any rom through fastboot: impossible, bootloader is locked
2 - to adb sideload an older rom OTA: no rom will be accepted, since NBD90W is the last one and you can't downgrade this way
3 - to adb sideload current rom OTA: works just fine, only thing I could do so far, but the phone remains in bootloop
4 - install a custom recovery through fastboot image.img: impossible, bootloader is locked
Click to expand...
Click to collapse
You're better off looking in the device-specific forum.
http://forum.xda-developers.com/nexus-5x
Unfortunately, I don't see a way to fix your problem that doesn't involve erasing your user data. You may have better luck in the subforum.
I don't care about my data. I'm giving up this phone after the last thing I've tried: I have successfully installed marshmallow (finally) through LGUP, and after I reboot it... stuck in bootloop! I don't know what this device problem is, but believe its a tiny hardware problem that will allow it to flash roms through various methods, while keep it stuck in bootloop. Does this make any sense at all?
Unlock the bootloader and flash a factory image.
Do a factory reset then flash latest stock rom

Oreo or Nougat recovery - STF-L09

Hi all,
Currently running Oreo (via OldDroid manual update) then LOS 15.1 (Berkley unofficial) on top, which is great but would like NFC, buttons, flashlight.
What is the best method to reinstate this functionality? I have tried the rollback for OldDroid rollback to no avail. I believe this method assumes you are rooted, which i am not.
Happy to be on EMUI 5 if necessary as i believe i can now update to Oreo OTA.
Cheers
Can i provide further pertinent information or ask elsewhere to get replies?
What did you do in the fist place to go from stock oreo to LOS 15.0 ; any links ?
Thank you.
I flashed the system image using "fastboot flash system system.img" via article https://www.xda-developers.com/lineageos-honor-view-10-huawei-mate-10-pro-project-treble/
Cheers
I think, once unrooted, you'll have to flash back stock system.
oslo83 said:
I think, once unrooted, you'll have to flash back stock system.
Click to expand...
Click to collapse
Great, thank you. I am not rooted so I extracted the system.img from STF-L09SC432B360a (from http://pro-teammt.ru/firmware-database/?firmware_model=STF-L09&firmware_page=0) using this guide https://forum.xda-developers.com/mate-10/how-to/guide-extracting-stock-firmware-files-t3756733
Then using that stock emui 8 system image:
"fastboot flash system system.img"
I receive the following error:
error: cannot load 'SYSTEM.img'
Any ideas?
Cheers
Another attempt at system.img extract using my windows box and the windows software referred to in https://forum.xda-developers.com/mat...files-t3756733.
This time i was able to flash the system.img successfully. When the device booted, it boot looped 3/4 times then i received :
Huawei eRecovery :
"Serious problems occurred when the phone boot, you are recommended to do factory data reset
NOTE: user data will be wiped after recovery".
I performed this reset and device booted to TWRP some commands took place but too quick (saw selinux buts thats it). Device rebooted twice then loaded Huawei eRecovery where the only option is :
Download latest version and recovery
Restore system with wifi
Entered wifi details
Getting package info from server
Getting package info failed.
Booting into TWRP the 'Factory Reset' option performs the same process that i saw when Huawei eRecovery recommended the factory data reset. Some i'm confident in what happened at that point now. Unsure as to what to try at this point. The phone does not boot into EMUI and will only boot to Huawei eRecovery.
The bootloader is unlocked, as per the process to install LineageOS 15.1 in the link in the OP. I've not checked if its still unlocked, but guess that could be causing a problem?
Just checked and bootloader is unlocked.
Interestingly the process to re lock it from the Huawei site (https://emui.huawei.com/en/unlock_step) shows that you have to use the same command to lock the bootloader as to lock it again:
Note: to re-lock the bootloader after unlocking it, restore the device’s software to the Huawei official version using a microSD card then switch the device to fastboot mode and enter “fastboot oem unlock ****************” in the computer’s command prompt, where * refers to the 16-digit unlock password. The device will then restart, and the bootloader lock status will change to “Bootloader Lock State: RELOCKED”.
If i follow those instructions i get the below error:
Code:
fastboot oem unlock **************** <-my 16 digit code
...
FAILED (remote: already fastboot unlocked)
Stop trying to lock your bootloader, it won't help you. Interresing info though.
Did it occur to you that after flashing back successfully system.img it could have been good to flash back stock recovery over twrp ?
This way you would have bootloop 3 or 4 times, and then stock recovery would have launch, not twrp.
I think a format system from this stock recovery, not twrp, would have solve your problem.
Thanks. So I can leave the boot loader unlocked at this point and run stock emui? I'll flash stock recovery. Perhaps that will suggest factory reset and then I'll be able to boot.
Thanks again.
oslo83 said:
Stop trying to lock your bootloader, it won't help you. Interresing info though.
Did it occur to you that after flashing back successfully system.img it could have been good to flash back stock recovery over twrp ?
This way you would have bootloop 3 or 4 times, and then stock recovery would have launch, not twrp.
I think a format system from this stock recovery, not twrp, would have solve your problem.
Click to expand...
Click to collapse
In order to revert to the stock recovery is it necessary to flash all three recovery images from the update.app file? :
recovery_ramdisk
recovery_vendor
recovery_vbmeta
Looking at flashing the recovery_ramdisk image with the stock version i have extracted using the below:
Code:
fastboot flash recovery_ramdisk RECOVERY_RAMDISK.img
Noticed the stock recovery_ramdisk i extracted has a filename of 'RECOVERY_RAMDIS.img', not ending in 'K' for 'RAMDISK. Presumably i can simply rename my recovery_ramdisk to "RECOVERY_RAMDISK.img" unless a 15 character filename is a limitation, or adjust my fastboot command to :
Code:
fastboot flash recovery_ramdisk RECOVERY_[B]RAMDIS[/B].img
Code:
fastboot flash recovery_ramdisk RECOVERY_RAMDIS.img
Did the trick to boot back into EMUI 8. However, i still have an intermittent torch/flashlight and the navigation keys/buttons do not work.
Any ideas on where i go from here?
mightyjcb said:
Code:
fastboot flash recovery_ramdisk RECOVERY_RAMDIS.img
Did the trick to boot back into EMUI 8. However, i still have an intermittent torch/flashlight and the navigation keys/buttons do not work.
Any ideas on where i go from here?
Click to expand...
Click to collapse
Follow instrucTions of this post: https://forum.xda-developers.com/showpost.php?p=75772700&postcount=2
and you will have all working again in B360 ;
This time while on bootloader:
fastboot flash kernel KERNEL_B360a_TOUCH_FIX.img
oslo83 said:
Follow instrucTions of this post: https://forum.xda-developers.com/showpost.php?p=75772700&postcount=2
and you will have all working again in B360 ;
This time while on bootloader:
fastboot flash kernel KERNEL_B360a_TOUCH_FIX.img
Click to expand...
Click to collapse
Many thanks @oslo83 followed that and just as you said hardware functioning correctly once again!
One further question for future reference, am i now in a position to apply OTA updates when released?
Cheers
You'll need to be unrooted and with stock recovery for applying ota when it will be available.
I don't know if you'll need stock kernel for ota...
mightyjcb said:
This time i was able to flash the system.img successfully. When the device booted, it boot looped 3/4 times then i received :
Huawei eRecovery :
"Serious problems occurred when the phone boot, you are recommended to do factory data reset
NOTE: user data will be wiped after recovery".
Click to expand...
Click to collapse
You need to flash stock recovery and do a factory reset in stock recovery.
oslo83 said:
You'll need to be unrooted and with stock recovery for applying ota when it will be available.
I don't know if you'll need stock kernel for ota...
Click to expand...
Click to collapse
Great, i should be able to meet this criteria quite easily then :
+ I've never rooted the device
+ I have reverted to stock recovery
+ I flashed the stock kernel over the top of the button fix kernel mentioned earlier in this thread.
Thanks again for your help, much appreciated.
zxz0O0 said:
You need to flash stock recovery and do a factory reset in stock recovery.
Click to expand...
Click to collapse
That seemed to do the trick! Ta.

fastboot boot recovery.img

hiya guys! So I just recently unlocked my d6503's bootloader after years of running it on stock. I wanted to access fastboot features for this device. My goal at the moment is edit to add just one line in build.prop to enable Multi-window. Right now my phone is on stock stock MM 23.5.A.1.291. I already tried flashing TWRP successfully to check if I can really edit the build.prop via fastboot commands (newbie here ) which I did. Right now my dillema is that either it's flashing the custom recovery, an unlocked bootloader, or simply editing the build.prop trips SafetyNet.
I am failing miserably to temporarily boot TWRP via fastboot. It gives me this feedback:
downloading 'boot.img'... OKAY. booting... FAILED (remote: dtb not found).
I did use the latest version of TWRP and even went ahead and used 2 of the previous versions via fastboot to no avail.

Unable to flash xt1941-4

Hey Guys,
I´m using a Motorola One xt1941-4. I tried to flash my phone since extensive googling suggested that this would be the only remedy for the issue of my phone only charging in fastboot mode.
I tried to do this with a locked bootloader since the $ fastboot oem get_unlock_data return failed: Unlock data unavailable. I flashed with what was the newest update from the lolinet servers via the sequence of commands given in the servicefile. During that i was unable to flash the boot.img though, which is, I imagine due to the locked bootloader. i still went through with the flashing.
Obviously it didn´t work though since my phone is now alwys going directly into fastboot showing this:
AP Fastboot Flash Mode (Secure)
SSM: boot image roll back: 11,12
failed to validate boot image
I thought this might be because i have to flash the exact firmware update i had installed preflash. I´m not sure which one that was though. I tried to flash all the available firmware on lolinet for my xt1941-4 to get the correct one- unsuccessfully. Help?
PirxRaumpilot said:
Hey Guys,
I´m using a Motorola One xt1941-4. I tried to flash my phone since extensive googling suggested that this would be the only remedy for the issue of my phone only charging in fastboot mode.
I tried to do this with a locked bootloader since the $ fastboot oem get_unlock_data return failed: Unlock data unavailable. I flashed with what was the newest update from the lolinet servers via the sequence of commands given in the servicefile. During that i was unable to flash the boot.img though, which is, I imagine due to the locked bootloader. i still went through with the flashing.
Obviously it didn´t work though since my phone is now alwys going directly into fastboot showing this:
AP Fastboot Flash Mode (Secure)
SSM: boot image roll back: 11,12
failed to validate boot image
I thought this might be because i have to flash the exact firmware update i had installed preflash. I´m not sure which one that was though. I tried to flash all the available firmware on lolinet for my xt1941-4 to get the correct one- unsuccessfully. Help?
Click to expand...
Click to collapse
Try fastboot getvar all command.
It should at least give you info about which update channel you're on and probably fingerprint as well. This would hopefully help in finding the right firmware for your device.

Categories

Resources