Bootloader Image File Flashing with an Unlocked Bootloader - General Topics

I am in the process of returning my old Pixel 3a back to the factory images and locking the bootloader. It was running the latest 3a factory image with a magisk patched boot image, so it was easy to revert back by simply flashing the factory boot image. Locking the bootloader seems simple enough using the fastboot command, but I noticed when I downloaded the factory image ZIP that there is a flash-all.bat file and a bootloader image file. The bat file preforms the following:
fastboot flash bootloader bootloader-sargo-b4s4-0.4-8048689.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-sargo-g670-00145-220106-b-8048689.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot -w update image-sargo-sp2a.220505.006.zip
Click to expand...
Click to collapse
Im curious what happens if a factory bootloader image is flashed with an unlocked bootloader? Does the flash replace the bootloader with one that is locked? Is this an alternative to running the fastboot command to lock the bootloader? I believe that in my current state, everything would be redundant except for the bootloader flash. Is that true?
This is the first time I have messed with locking the bootloader and am trying to not brick the device!
Thanks for the help!
-Ryan

radensb said:
I am in the process of returning my old Pixel 3a back to the factory images and locking the bootloader. It was running the latest 3a factory image with a magisk patched boot image, so it was easy to revert back by simply flashing the factory boot image. Locking the bootloader seems simple enough using the fastboot command, but I noticed when I downloaded the factory image ZIP that there is a flash-all.bat file and a bootloader image file. The bat file preforms the following:
Im curious what happens if a factory bootloader image is flashed with an unlocked bootloader? Does the flash replace the bootloader with one that is locked? Is this an alternative to running the fastboot command to lock the bootloader? I believe that in my current state, everything would be redundant except for the bootloader flash. Is that true?
This is the first time I have messed with locking the bootloader and am trying to not brick the device!
Thanks for the help!
-Ryan
Click to expand...
Click to collapse
No, it does not lock the bootloader.
Actually you need to unlock the bootloader before you flash the factory image using fastboot.
The instruction section has become a bit confusing with the newer changes and options but..
Factory Images for Nexus and Pixel Devices - [developers.google] - Flashing instructions
To explain the flash-all.bat file.
fastboot flash bootloader bootloader-sargo-b4s4-0.4-8048689.img
- Flashes the new bootloader image to the bootloader partition.​
fastboot reboot-bootloader
- Reboot to bootloader.​
ping -n 5 127.0.0.1 >nul
- One way to do a 5 second delay while waiting for the device to reboot into fastboot.​
fastboot flash radio radio-sargo-g670-00145-220106-b-8048689.img
- Flashes the new radio image (the mobile/phone parts) to the radio partition.​
fastboot reboot-bootloader
- Reboot to bootloader.​
ping -n 5 127.0.0.1 >nul
- One way to do a 5 second delay while waiting for the device to reboot into fastboot.​
fastboot -w update image-sargo-sp2a.220505.006.zip
- Runs the fastboot update command on the rest of the image file(s).
- The -w is the wipe command and will erase/format userdata (all your files) and cache.​
The only thing I would recommend after flashing the full factory update would be to switch slots and flashing the full factory update again.
That way both slots are set back to factory stock.
Then make sure you can boot into the stock system, if you can then you should be safe to lock the bootloader.
Cheers.
B.

Related

Remove twrp and get back to factory state, need help!!!

Hi guys
I'll receive the rma device tomorrow and i wanted to set to factory state the one i have right now , so that i can send it back to google.
I have installed a custom recovery(twrp) and rooted the device.
Would any one be so kind to guide me to the the reverse process and make the device like it was when it shipped to me.
Thanks in andvance
td32 said:
Hi guys
I'll receive the rma device tomorrow and i wanted to set to factory state the one i have right now , so that i can send it back to google.
I have installed a custom recovery(twrp) and rooted the device.
Would any one be so kind to guide me to the the reverse process and make the device like it was when it shipped to me.
Thanks in andvance
Click to expand...
Click to collapse
See here.
gregc2009 said:
See here.
Click to expand...
Click to collapse
is it necesary to execute all this commands
Code:
fastboot flash bootloader C:/image-hammerhead-krt16m/bootloader.img
fastboot reboot-bootloader
fastboot flash radio C:/image-hammerhead-krt16m/radio.img
fastboot reboot-bootloader
fastboot flash system C:/image-hammerhead-krt16m/system.img
fastboot flash userdata C:/image-hammerhead-krt16m/userdata.img
(Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked.)
fastboot flash boot C:/image-hammerhead-krt16m/boot.img
fastboot flash recovery C:/image-hammerhead-krt16m/recovery.img
fastboot erase cache
or this is enough for my case?
Code:
fastboot flash recovery C:/image-hammerhead-krt16m/recovery.img
fastboot erase cache
just flash the recovery image then
Wipe data/factory data reset"
and for last lock the bootloader?
td32 said:
is it necesary to execute all this commands
Code:
fastboot flash bootloader C:/image-hammerhead-krt16m/bootloader.img
fastboot reboot-bootloader
fastboot flash radio C:/image-hammerhead-krt16m/radio.img
fastboot reboot-bootloader
fastboot flash system C:/image-hammerhead-krt16m/system.img
fastboot flash userdata C:/image-hammerhead-krt16m/userdata.img
(Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked.)
fastboot flash boot C:/image-hammerhead-krt16m/boot.img
fastboot flash recovery C:/image-hammerhead-krt16m/recovery.img
fastboot erase cache
or this is enough for my case?
Code:
fastboot flash recovery C:/image-hammerhead-krt16m/recovery.img
fastboot erase cache
just flash the recovery image then
Wipe data/factory data reset"
and for last lock the bootloader?
Click to expand...
Click to collapse
I would do it all just to make sure you are back to complete stock since you mentioned you rooted the device also.
Follow the instructions in the first post of this thread and since you plan to RMA the phone be sure to check the tamper flag and follow the steps outlined to reset it if necessary... http://forum.xda-developers.com/showthread.php?p=47156064
[TUTORIAL] How to flash a factory image | Return to stock | Unroot your Nexus 5
Sent from my Nexus 5 using xda app-developers app
chef_christoph said:
Follow the instructions in the first post of this thread and since you plan to RMA the phone be sure to check the tamper flag and follow the steps outlined to reset it if necessary... http://forum.xda-developers.com/showthread.php?p=47156064
[TUTORIAL] How to flash a factory image | Return to stock | Unroot your Nexus 5
Sent from my Nexus 5 using xda app-developers app
Click to expand...
Click to collapse
Code:
. If the tamper flag value is "true", then you'll have to reset it. The following steps will reset this flag, and lock your bootloader.
•So, first, go here: http://forum.xda-developers.com/show....php?t=2239421 (Thanks @osm0sis for the wonderful script)
Under "Flashable Zips", you will find the Nexus BootUnlocker script. Download it.
•Put the zip on your internal storage.
•Download the latest TWRP recovery image for the Nexus 5 from here: http://techerrata.com/browse/twrp2/hammerhead. Rename it to TWRP.img.
Now boot it. You do this by booting your phone in fastboot, and typing the following command:
Code:
fastboot boot path/to/TWRP.img
TWRP recovery should boot.
•Flash the zip in TWRP, then reboot.
Now your bootloader should be locked, and your tamper flag should show "false".
So i have to do this before i flash the stock recovery, since it needs TWRP, am i right?
And else it says that this will lock the bootloader, will i be able to execute the previous commands(flashing recovery and stuff) with a locked bootloader?
td32 said:
So i have to do this before i flash the stock recovery, since it needs TWRP, am i right?
And else it says that this will lock the bootloader, will i be able to execute the previous commands(flashing recovery and stuff) with a locked bootloader?
Click to expand...
Click to collapse
No, flash everything back to stock then deal with the tamper flag reset.
Once everything is back to stock but the bootloader is still unlocked, boot into the recovery...
fastboot boot nameofrecovery.img
Then flash the tamper flag script.
Sent from my Nexus 5 using xda app-developers app
chef_christoph said:
No, flash everything back to stock then deal with the tamper flag reset.
Once everything is back to stock but the bootloader is still unlocked, boot into the recovery...
fastboot boot nameofrecovery.img
Then flash the tamper flag script.
Sent from my Nexus 5 using xda app-developers app
Click to expand...
Click to collapse
Sorry man but i'm not getting something here.
If i flash everything first, even the recovery will be stock, so i have to flash twrp once again to flash the tamper flag script. So i end up with twrp recovery and the tamper flag reset, while it should be stock recovery and tamper flag reset.
What i'm i missing here?
You can boot a custom recovery without flashing it. Like a temporary installation
Sent from my Nexus 5
pepdavies said:
You can boot a custom recovery without flashing it. Like a temporary installation
Sent from my Nexus 5
Click to expand...
Click to collapse
ok thank, now its all clear
i should have paid more attention to the command :silly:
It says boot not flash :silly:
Thanks for you help guys

Bircked Help?

I have anexus 5 that is stuch on the google logo or is stuck in a boot lopp than it gets frozen and when plugegd in the battery logo turns on. I can go into recovery (twrp), but everything on my phone ghas been erased so theres nothing to flash. I tried to use a Nexus 5 toolkit to stock flash but it always comes up with an error. When i try something on twrp it says unable to mount....and give like 5-6 different thinbgs that it cant mount to. Everytime i try to flaash a new bootloader or something from that toolkit the phone turns off and goes into the battery logo. When i use twrp and try to do anything the phone just restarts into recovery. Is there any way i could push factory images to the phone or something else.
BTW, i dont know mucgh in terms of doing stuff with adb and terminal and all that so please be simplistic with the answers. Thanks in advance,.
http://forum.xda-developers.com/showthread.php?t=2513701
[TUTORIAL] How to flash a factory image | Return to stock | Unroot/SAVE your Nexus 5
Sent from my Nexus 5
CRIME INC. said:
http://forum.xda-developers.com/showthread.php?t=2513701
[TUTORIAL] How to flash a factory image | Return to stock | Unroot/SAVE your Nexus 5
Sent from my Nexus 5
Click to expand...
Click to collapse
So i did this and it failes when at the bootloader and alos at the end it says failure. What to do now?
Irfdiddy said:
So i did this and it failes when at the bootloader and alos at the end it says failure. What to do now?
Click to expand...
Click to collapse
Go to twrp and factory reset it and see if it works..
Write failure means that the eMMC might have died which can only be solved by replacing the mobo.
- Sent from an IceCold Hammerhead!
Irfdiddy said:
So i did this and it failes when at the bootloader and alos at the end it says failure. What to do now?
Click to expand...
Click to collapse
You're being too vague for us to help you. What commands did you enter at the terminal? Word for word what was the error message(s) you received? Did you try flashing the factory image using both the primary and backup bootloader?
BirchBarlow said:
You're being too vague for us to help you. What commands did you enter at the terminal? Word for word what was the error message(s) you received? Did you try flashing the factory image using both the primary and backup bootloader?
Click to expand...
Click to collapse
So i followed the guide in the link posted above. This:
fastboot flash bootloader C:/image-hammerhead-krt16m/bootloader.img
fastboot reboot-bootloader
fastboot flash radio C:/image-hammerhead-krt16m/radio.img
fastboot reboot-bootloader
fastboot flash system C:/image-hammerhead-krt16m/system.img
fastboot flash userdata C:/image-hammerhead-krt16m/userdata.img
(Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked.)
fastboot flash boot C:/image-hammerhead-krt16m/boot.img
fastboot flash recovery C:/image-hammerhead-krt16m/recovery.img
fastboot erase cache
Now, i can flash the boot.img, the system.img, the radio, but it hangs up on some of the other ones and it says "erasing..." than i have to stop it casue it doesnt work. Also, when i go into recovery it shows a spinning android logo.
Edit: Ive gotten all the way to "fastboot flash system system.img", but it gets stuck on my phone and says "erasing..."
Irfdiddy said:
So i followed the guide in the link posted above. This:
fastboot flash bootloader C:/image-hammerhead-krt16m/bootloader.img
fastboot reboot-bootloader
fastboot flash radio C:/image-hammerhead-krt16m/radio.img
fastboot reboot-bootloader
fastboot flash system C:/image-hammerhead-krt16m/system.img
fastboot flash userdata C:/image-hammerhead-krt16m/userdata.img
(Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked.)
fastboot flash boot C:/image-hammerhead-krt16m/boot.img
fastboot flash recovery C:/image-hammerhead-krt16m/recovery.img
fastboot erase cache
Now, i can flash the boot.img, the system.img, the radio, but it hangs up on some of the other ones and it says "erasing..." than i have to stop it casue it doesnt work. Also, when i go into recovery it shows a spinning android logo.
Edit: Ive gotten all the way to "fastboot flash system system.img", but it gets stuck on my phone and says "erasing..."
Click to expand...
Click to collapse
It will take some minutes to cOmplete the process computer will also hang type of feeling or stop responding for couple of minutes let the program finish its task,...
Irfdiddy said:
So i followed the guide in the link posted above. This:
fastboot flash bootloader C:/image-hammerhead-krt16m/bootloader.img
fastboot reboot-bootloader
fastboot flash radio C:/image-hammerhead-krt16m/radio.img
fastboot reboot-bootloader
fastboot flash system C:/image-hammerhead-krt16m/system.img
fastboot flash userdata C:/image-hammerhead-krt16m/userdata.img
(Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked.)
fastboot flash boot C:/image-hammerhead-krt16m/boot.img
fastboot flash recovery C:/image-hammerhead-krt16m/recovery.img
fastboot erase cache
Now, i can flash the boot.img, the system.img, the radio, but it hangs up on some of the other ones and it says "erasing..." than i have to stop it casue it doesnt work. Also, when i go into recovery it shows a spinning android logo.
Edit: Ive gotten all the way to "fastboot flash system system.img", but it gets stuck on my phone and says "erasing..."
Click to expand...
Click to collapse
You're not letting it finish. That's why you're having problems. It can take a long time. It also wouldn't hurt to use the flash-all.bat script instead of flashing each individually.

Can the 'bootloader' be downgraded to 25r?

As the title states...can we flash just the bootloader from 25R onto 30O using fastboot? And if so, therefore allow for the temporary boot of a custom recovery. Until now, I've only owned/flashed Samsung devices so still learning the fastboot idioms. Any ideas or nah?
You can boot a recovery without flash it .. fastboot boot recovery.img
Why are you wanting to downgrade a bootloader to 25R? There aren't any restrictions.
If you want to temporarily boot a recovery, then just type what nneves said.
Theres no need to downgrade your bootloader.
Since the firmware has been updated to 30O, this cannot be done. I used the 'boot recovery' method while on 25R, but for some reason (security?) they have blocked that exploit, hence the question at hand.
I had even tried this method I found in a Nexus forum:
Here's some instructions I compiled for doing useful things with your Nexus. Also includes instruction to root nexus 4 without installing a custom recovery. Basically, you save the customrecovery.zip file then fastboot boot into it (NOT install, and notice you have to type the full command specified below, not just "fastboot boot customrecovery.img") and then install using the custom recovery, install SuperSU.zip for unrooting:
1) Install all STOCK files:
./fastboot flash bootloader bootloader-XXX.img ./fastboot reboot-bootloader ./fastboot flash radio radio-XXX-XXX.img ./fastboot reboot-bootloader ./fastboot -w update image-XXX-XXX.zip ./fastboot oem unlock (to unlock bootloader)
2) If you want to keep stock recovery, fast boot BOOT into custom recovery and install SuperSu.zip: 3) Install SuperSu.zip file (to root)
./fastboot -c "lge.kcal=0|0|0|x" boot customrecovery.img
there used to be a 'fastboot boot recovery recovery.img' command, but Google removed it in 4.3, so now to simply boot into your custom recovery you can type 'fastboot -c "lge.kcal=0|0|0|x" boot customrecovery.img' instead and it'll do the same thing as the 'fastboot boot' command. Meaning it will revert to your stock recovery once you reboot. So boot into custom recovery, flash superuser (Koush or Chainfire's) and reboot. done.
It didn't work but maybe another code for our device is needed?
Just going to give this a little bump...
there is a stock 25R ROM zip floating around here somewhere. you should just be able to flash it via recovery using twrp, if you're just wanting to go back to flat stock. let me know if you can't find it, i think i may have it somewhere.
Wouldn't you need to unlock the bootloader to downgrade to 25R? I think that there would be some sort of check in the signed 25R OTA update that would prevent you from flashing it.

[Q] Stuck on boot screen after flashing Lollipop factory images

Hey,
I flashed the factory images for my Nexus 5 (T-Mobile) and it's stuck on the boot screen (flying dots).
I got the images from here: https://developers.google.com/android/nexus/images#hammerhead
I have fastboot and adb installed and used the sh script contained in the downloads to the flash the phone.
For reference:
Code:
fastboot flash bootloader bootloader-hammerhead-hhz12d.img
fastboot reboot-bootloader
fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.21.img
fastboot reboot-bootloader
fastboot -w update image-hammerhead-lrx21o.zip
It didn't boot after about 15 minutes so I flashed it again and am another 20 minutes in now. I think I can probably flash the 4.4.4 image back (right?), but what could be wrong with Lollipop on my phone?
dont flash them flash-all, flash all the imgs individually.
I reflashed from windows 8 and it booted up real quick. Weird.
Mine got stock at boot screen. I went to recovery and factory reset fixed it.

Pixel 5/Android 11 - Update requires 'bramble'

I've got a BIG problem with my new Pixel 5. I've successfully rooted it and had it operating for a day.
I then decided to boot into recovery mode just to see what the new stock recovery looks like (I used to use TWRP.).
BIG MISTAKE!
All I got was the error icon that I've seen in the past meaning that no recovery image is available. OK, so I try to just try to do a simple reboot. I'm taken back to the same place.
Now I try to reload Android. No luck! I'm stuck on:
"Device product is 'unknown'"
Update requires 'bramble'.
HELP!!!!
In the file android-info.txt, what would happen if I patched the line
require board=bramble
to
require board=unknown
Did you figure this out? I'm facing the same issue with my Pixel 5.
Edit: I figured it out. If you are having an issue with the 'flash-all.bat' command like we were, you just need to manually push the individual files and it should boot you back up into stock.
Run these commands:
1. fastboot flash bootloader <bootloader image file>
2. fastboot reboot-bootloader
3. fastboot flash radio <radio image file>.img
4. fastboot reboot-bootloader
5. fastboot update <image zip file>.zip
6. fastboot reboot
All of the reboot-bootloader commands may be redundant but it worked for me. It booted me into stock, verified I was unrooted with Root Checker, then proceeded to reboot back into the bootloader and 'fastboot flashing lock' to re-lock my bootloader and wipe the device.

Categories

Resources