1. Check out our app, Forums for Android! Download and leave feedback here!

[Guide]How to flash a Nexus Factory Image manually.

Discussion in 'Android System Mods, Scripts and Hacks' started by jhawkkw, Apr 3, 2013.

  1. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    If you take a peek in that flash-all script you can see exactly what it's doing. Based on my memory, it:
    1. Flashes the bootloader image.
    2. Reboots.
    3. Flashes the recovery image.
    4. Reboots.
    5. Flashes the modem/radio image.
    6. Reboots.
    7. Flashes system, userdata, and cache images all at once.
    8. Reboots.
    So you still need to do the fastboot oem unlock step (to unlock the bootloader), but you can otherwise just execute Flash-All and call it a day*.

    * Unless something fails to flash, which seems to be a commoner and commoner thing lately. You'll then likely need to flash the filesystems individually as described at the top of this thread. ;)
     

    Advertisement

  2. redkulat89

    redkulat89 New Member
    15

    May 29, 2015
    3
    0
    15
    Male
    Thanks a ton for this, I've been looking at many places for this answer! Just one more quick question, do you I have to execute the erase steps?

    fastboot erase boot
    fastboot erase cache
    fastboot erase recovery
    fastboot erase system

    Not a major issue, just wasn't sure if it was necessary.
     
  3. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    Probably not strictly necessary, as those filesystems get overwritten when you flash them, but it's probably a good idea to do it just to make sure you start from a clean slate. :thumbsupdroid:
     
    redkulat89 likes this.
  4. Ted Gottfried

    Ted Gottfried Member
    6

    May 15, 2015
    5
    1
    6
    I am stuck using your guide
    How to flash a Nexus Factory Image manually. I have a nexus 5 that I completely screwed up trying to revert back to stock from root. Maybe it's looping. I am stuck here:

    Step 9: We will now flash the bootloader. It is important that you do not disconnect the device or mess with it during this step or else you hard brick the device.
    fastboot flash bootloader "name of boot loader"

    This is what happens in the terminal:

    ./fastboot-mac flash bootloader-hammerhead-hhz12h.img
    unknown partition 'bootloader-hammerhead-hhz12h.img'
    error: cannot determine image filename for 'bootloader-hammerhead-hhz12h.img'

    Thanks for your continued help.

    Ted
     
  5. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    The syntax for "fastboot flash" (or the Mac equivalent) is:
    fastboot flash <partition> <filename>

    You're not giving it a valid partition name. ;)

    So try:
    Code (Text):
    1. ./fastboot-mac flash bootloader bootloader-hammerhead-hhz12h.img
    I bet you'll have better luck. :thumbsupdroid:
     
    lunatic59 likes this.
  6. Ted Gottfried

    Ted Gottfried Member
    6

    May 15, 2015
    5
    1
    6

    That did the trick. Thank you!
     
    codesplice likes this.
  7. vabvaibhav

    vabvaibhav Member
    16

    Jun 9, 2015
    7
    8
    16
    I got a few errors during step 11
    archive does not contain 'boot.sig'
    archive does not contain 'recovery.sig'
    archive does not contain 'system.sig'
    archive does not contain 'vendor.sig'

    and now my phone is stuck at the initial Google screen? Suggestions?
     
    #82 vabvaibhav, Jun 9, 2015
    Last edited: Jun 9, 2015
  8. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    Hi and welcome to Android Forums :)

    Could you provide us some additional information - like what device you have and what version you're trying to flash?

    Those "archive does not contain..." messages aren't generally an error-level message as I recall... those shouldn't be causing the installation to fail. Is there any other output you could share?
     
    vabvaibhav likes this.
  9. lunatic59

    lunatic59 Moderati ergo sum
    Moderator
    4,138

    Jun 12, 2010
    31,625
    25,577
    4,138
    Male
    IT
    Pennsylvania
    Are you sure it doesn't say boot.img? I get that when trying to use the flash-all.bat script, too. It's just a matter of unzipping the archive that does contain those images and flashing them individually.

    Try this. Read that post and the one following to see if that's your problem.
     
    vabvaibhav and codesplice like this.
  10. vabvaibhav

    vabvaibhav Member
    16

    Jun 9, 2015
    7
    8
    16
    I am using a Nexus 4 and I tried to flash the most recent version from the google website.

    After I saw those errors, I tried installing the other way (using the four commands) and I got done without any errors. The phone froze at the first Google screen... and then I passed out.

    When I woke up, I tried to boot the phone. It got to the four dots animation and froze there. I plugged it back into charging and then I saw a constant red LED (no flashing).

    Since then I have not been able to boot the phone, normally or in bootloader.
     
  11. vabvaibhav

    vabvaibhav Member
    16

    Jun 9, 2015
    7
    8
    16
    I just unzipped everything into one giant folder. The installation was executed perfectly without any errors and as per the instructions. [​IMG]
     
    lunatic59 likes this.
  12. vabvaibhav

    vabvaibhav Member
    16

    Jun 9, 2015
    7
    8
    16
    The phone won't even turn on anymore. Not even the red LED. So, I am inclined to believe it is a hardware problem. Well, at least it ran well for two years. You guys are doing an amazing job here. Thank you so much for the guide and the additional help and keep up the good work.
     
    lunatic59 and codesplice like this.
  13. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    Were you having any problems with the phone before trying to flash the factory image?

    You may want to try leaving the phone powered off but on charge for an hour or two. Sometimes it will do silly things if the battery voltage gets dangerously low.
     
    vabvaibhav likes this.
  14. vabvaibhav

    vabvaibhav Member
    16

    Jun 9, 2015
    7
    8
    16
    Umm.. If I remember correctly, I saw the phone reboot and it rebooted into the "optimizing apps screen". Before that, the phone got really slow, almost unresponsive. I first went with factory reset which went smooth. But then the phone froze at the optimizing apps screen again. Then I tried to flash it and it stopped at the Google screen. The most recent freeze was the moving dots animation for lolipop.
     
    codesplice likes this.
  15. lunatic59

    lunatic59 Moderati ergo sum
    Moderator
    4,138

    Jun 12, 2010
    31,625
    25,577
    4,138
    Male
    IT
    Pennsylvania
    How long did you let it "optimize"? That can take what seems to be an unreasonably long time after a fresh flash. Follow @codesplice 's recommendation and make sure you have a full charge.

    Sometimes a failed flash or failed boot can leave the phone in a "semi-on" state where it's really on but frozen. Try holding the power button for 30 seconds or so and see if you can get any kind of response. You might try it with the volume buttons as well at this point.

    As they say in Brooklyn ... cuddint hoit. ;)
     
    vabvaibhav and codesplice like this.
  16. vabvaibhav

    vabvaibhav Member
    16

    Jun 9, 2015
    7
    8
    16
    HEY GUYS! GUYS!
    I use a 20AWG cable for faster charging and it prevents the phone from going into data transfer mode, and another cable for doing everything else. So, apparently, my phone wasn't charging last night while it was plugged in. I followed what @codesplice said and let the phone charge and.... VOILA! Google Welcome screen asking me for my language. It is running smoothly now.

    You guys saved me from buying a new phone. I should probably do it eventually since I have been dropping my 'mako' regularly for the past two years. :D

    I can't thank you enough for all your help and looking for options even though I had lost hope. You guys are AWESOME! I wish I was as cool and knowledgeable as you! Keep Rockin' :)
     
    lunatic59 and codesplice like this.
  17. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    Nice! Thanks for letting us know that you're up and running! :)

    Feel free to stick around - us "cool and knowledgeable" guys started pretty much where you are. It's amazing what you can learn by hanging out on a community like this one. ;)
     
    lunatic59 and vabvaibhav like this.
  18. lunatic59

    lunatic59 Moderati ergo sum
    Moderator
    4,138

    Jun 12, 2010
    31,625
    25,577
    4,138
    Male
    IT
    Pennsylvania
    Great news!! Always nice to hear a success story. Could you clarify something for me though? Which one of us is "cool" and which is "knowledgeable"? I need it for the jackets. ;)
     
    codesplice likes this.
  19. vabvaibhav

    vabvaibhav Member
    16

    Jun 9, 2015
    7
    8
    16
    If I was asked to split the hair, I would say that you come off as a little more "cool" with your writing style as you try to boost the morale of the person whose beloved device is dying, whereas @codesplice writing is pointed at bringing the poor device back to life and putting the person out of misery. You make a great duo! :')
     
    codesplice and lunatic59 like this.
  20. lunatic59

    lunatic59 Moderati ergo sum
    Moderator
    4,138

    Jun 12, 2010
    31,625
    25,577
    4,138
    Male
    IT
    Pennsylvania
    I told you I was the cool one, CS. :p ;)
     
    codesplice and vabvaibhav like this.
  21. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    I did earn that "Geek" merit badge yesterday...
     
    lunatic59 likes this.
  22. Robert Surrena

    Robert Surrena New Member
    15

    Jun 8, 2015
    2
    0
    15
    There is no cache.img for the Verizon galaxy nexus
     
  23. codesplice

    codesplice Elite Recognized Moderator
    Moderator
    1,063

    Oct 29, 2013
    7,916
    8,705
    1,063
    Male
    SysAdmin
    Huntsville, AL
    You are correct. Is that causing issues for you?
     
  24. Robert Surrena

    Robert Surrena New Member
    15

    Jun 8, 2015
    2
    0
    15
    I am not sure, I cant seem to get it so that I can activate it on the verizon network. Do I need to flash both radio files at the same time or is one right after the other good enough?
     
  25. Falkner

    Falkner New Member
    5

    Jul 8, 2015
    1
    0
    5
    Male
    YOU!! YA YOU! UR AWESOME :D This helped me after having a soft bricked nexus 5 for days evns nrt wasnt working for me :D Thx ALOT
     

Share This Page

Loading...