Dunno how to flash stock kernel + lock bootloader - Nexus 5 Q&A, Help & Troubleshooting

I want to do both before I send back my original Nexus 5.
I tried "./flash-all.sh" (without quotes) after cd directing Terminal to the hammerhead folder on my Mac and its not taking it.
Downloaded the factory image and extracted it from Google's site.
...I just want stock kernel (on stock ROM, though rooted but that shouldn't matter), feeling really noob-ish.

Related

[Q] Problems loading factory image

I've looked all over, but cannot find anything on the problem I am having.
I go through the steps to load the current factory image onto my nexus s 4g through terminal on my mac, but for some reason it doesn't load everything. Here's what it says in terminal about the items that can't load:
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
And here's what my folder looks like where I'm loading everything from:
I guess I can't post a picture from an outside source, so I'll just type in what my folder looks like:
boot.img
bootloader-crespo4g-d720spric1.img
flash-all.bat
flash-all.sh
flash-base.sh
image-sojus-jro03r
image-sojus-jro03r.zip
radio-crespo4g-d720sprilf2.img
there are files in the unzipped folder (image-sojus-jro03r) named:
android-info.txt
recovery.img
system.img
userdata.img
These seem to be some of the files that are missing, but even when i drag them over to the main folder, they still don't load. maybe something to do with the fact that they are .sig's?
I drag the flash-all.sh file into terminal and it loads and writes everything except for these .sig's, which I truthfully don't know what they are. Now I can't get into the correct recovery mode, it just shows some weird blue-lettered options that are different then the normal recovery options. That is why I think the fact that these .sig files are not loading is the problem.
I also booted up the new operating system and signed on, but for some reason none of my apps can download.
Sorry for my noobness, but I'm sure I'm missing one easy step that will fix my problems.
Does anyone know what I'm going through?
Any help is much appreciated.
Alright. I've searched the web and found a few different things. It seems that it's common for those .sig files to not load. Also, i loaded the factory image again and was able to download my apps.
I also now foolishly realize that to get a good version of recovery, I need to root my phone. I'm in terminal now, and for some reason adb is not showing my phone in adb devices. This wasn't a problem when I loaded the factory image, but now it's a problem when I'm trying to do this: http://forum.xda-developers.com/showthread.php?t=1129759
step 5 is a problem, but hey, I can turn off the phone and go into fastboot mode myself. I guess step 7 is the next problem I'm dealing with. Here's what I get in terminal when I do step 7 manually (I put a *#* where my name is just so everyone knows):
MacBook:~ *#*$ /Users/*#*/Desktop/adb-fastboot/recovery-clockwork-5.0.2.0-crespo.img
-bash: /Users/*#*/Desktop/adb-fastboot/recovery-clockwork-5.0.2.0-crespo.img: Permission denied
Does anyone know what I'm dealing with this time around?
You probably need to enable adb in Settings --> Developer Options. If it's an issue with adb while in recovery, i'm pretty sure the stock recovery (which will be overwritten on every boot from a stock ROM) doesn't allow it. What you need to do is flash a new recovery in fastboot (not in recovery).
Commands (while in fastboot mode):
/path/to/fastboot devices <-- this will tell you if your phone is connected properly
/path/to/fastboot flash recovery /path/to/recovery.img <-- this will flash the new recovery
You'll need to type in the path to fastboot unless you have it in somewhere like /bin or a more convenient environmentally recognised location. The command you typed there is the same as trying to open the .img file as a script, you want to tell fastboot to flash the file to the phone and not open it with the computer.
Edit: Also, once you root, you probably want to delete /system/etc/install-recovery.sh. That file replaces any custom recovery with stock each time you boot.
Thanks Harbb.
That's what I ended up doing, using fastboot. it worked perfectly. I did try to find the /system/etc/install-recovery.sh file in root explorer, but could not find it. don't know where it is.
Everything is rooted and restored on my custom rom to where I was previously using titanium backup.
Here's the tutorial I was using: http://forum.xda-developers.com/showthread.php?t=1129759
with this video being a walkthrough of the previous tutorial: http://www.youtube.com/watch?v=sP9ZDWmbLVM
I was actually using the recovery img in the android folder that I downloaded from the tutorial, and not the one he told me to download, which was my problem in the end. Here's the link to the download page where I should have downloaded it from: http://forum.xda-developers.com/showthread.php?t=988686&highlight=clockwork+4.0.0.2
Thanks again Harbb, much appreciated.
No worries buddy, glad you got it sorted.

[Q] I've really messed up my phone, can't seem to install stock ROM now

How can I flash a stock ROM considering I cannot boot the phone up normally in order to put the file onto the phone? The Moto G has no external storage so I can't use an SD card.
I get get into the bootloader, and I have managed to install Team Win Recovery Project but don't know what else to do!
Euskadi said:
How can I flash a stock ROM considering I cannot boot the phone up normally in order to put the file onto the phone? The Moto G has no external storage so I can't use an SD card.
I get get into the bootloader, and I have managed to install Team Win Recovery Project but don't know what else to do!
Click to expand...
Click to collapse
Disclaimer : I have not used TWRP recovery on Moto G. So may have errors in my post
You have 2 options.
1. On some versions of TWRP, under advanced you have an option to mount USB. You can the access the phone as a drive from a computer.
2. Use ADB to push file to the phone. Install drivers and ADB works in recovery,
Thanks I actually found out about the adb push thing just after making this thread. I was able to push Beanstalk onto the device and install it through TWRP, however it's just stuck on the Beanstalk bootscreen forever. I tried installing it again and the same thing is happening. This also happened earlier when I tried to install Cyanogenmod
Once when i wanted to flash Stock 4.3 i got also stuck in bootanimation.
To restore Stock i had to execute flashall.bat /eu. The option /eu erases userdata. Once i did this my phone booted without any issues.
So what you can try is to erase userdata via fastboot or cwm
fastboot erase userdata
Click to expand...
Click to collapse
onyinly made
I tried one final Hail Mary before going to be last night, erased all data and installed Cyanogenmod again and I'm pleased to say it worked!
Only downside is I've lost all my apps & data. Now I did back these up using Titanium, and stored them on Google Drive, however the reason I got into this mess in the first place is because I manually flashed the 4.4.2 update, which worked ok, but then when I restored my apps/data with Titanium my soft buttons (back button etc) disappeared!
I guess I'll just play it safe and not try to restore the back up this time.
M8 u couldn't give a walk through guide how u pushed ROM to phone pls
Sent from my HTC Desire C using XDA Premium 4 mobile app
the sarge said:
M8 u couldn't give a walk through guide how u pushed ROM to phone pls
Click to expand...
Click to collapse
Not exactly an expert myself but look for a download of 'Fastboot', it should have a program called adb.exe or abd-windows.exe. Turn on your phone while holding the Volume Down button and it should start into the bootloader screen, plug in the USB and it will say it's connected.
Then you go to the folder (on your PC) that has adb.exe - put your ROM .zip into this folder - then hold shift and right-click somewhere inside the folder (not on a file) and choose "Open command window here".
Then you just type "adb push ROM.zip /sdcard" where ROM.zip is the name of the zip file. note: you might have to type adb-windows instead, depends what .exe you have
Then just wait until it finishes transferring. Will take 30 secs or so for a 200mb ROM.
I'm sure if you google "adb push" you'll get some better instructions, with downloads etc
While reverting to stock it's important to use mfastboot(moto-fastboot) instead of normal fastboot. Download mfastboot.exe and place in adb folder, and replace 'fastboot' commands with 'mfastboot'
Sent from my XT1032 using XDA Premium 4 mobile app
Or try supertool on root junkies download site worked for me to get o t a kit kat
Sent from my Moto G using XDA Premium 4 mobile app

[Q] how to manually update android on the nexus 5

Hi,
I read that once I will root my phone I will lose over the air updates. But how to manually update it? I use CWM. And will i need to reroot the phone after the update?
Thanks in advance!
Just flash the 4.4.4 zip in recovery. Don't wipe cache or anything. You won't lose data or root, you might have to flash super user in recovery after. I have survival mode on in super user and did not need to reflash su. The zip can be found here http://forum.xda-developers.com/google-nexus-5/development/rom-stock-4-4-3-ktu84m-odex-deodex-t2771010
You will not use otas if you rooting. You will get otas even if you are on a cm rom.
Here is how ota works:
Cheks those system files which have to be updated. If any of those system files is different, then the update fails and will show you an error about unexpected content in xxxx file. If every system files got checked and they are all good for the ota, then it starts patching the files. Then it flashes bootloader (if any), modem (if any), kernel (if any) and copies the recovery image to /system and a script to /system/etc/ then the phone restarts. At booting the phone flashes the new recovery and done.
Tapatalk-kal küldve az én Nexus 5-el
r3m10 said:
Hi,
I read that once I will root my phone I will lose over the air updates. But how to manually update it? I use CWM. And will i need to reroot the phone after the update?
Thanks in advance!
Click to expand...
Click to collapse
Install SDK, and make sure that /platform-tools dir is in your PATH (environmental variable) so you can use fastboot and adb from cmd line. Then
1. Download the factory pack from Google
2. Extract it (you can use winrar/7zip, or whatever)
3. Edit the Flash-all script (remove the "-w" if you don't want it to wipe, and the line to flash recovery if you want to keep CWM).
4. Boot your device into bootloader mode, connect via usb
5. run the cmd "fastboot devices" to check your computer see's your device, if not.. you need to configure your drivers
6. run the Flash-all script
That's it.
What is the advantage in doing all those extra steps when you can just dirty flash 4.4.4? I know for a major android version upgrade you'd want to do a clean install, but this is such a minor one. And please don't say something like....to learn how to use fastboot commands.
Lokke9191 said:
And please don't say something like....to learn how to use fastboot commands.
Click to expand...
Click to collapse
Those instructions don't require you to know any fastboot commands (the script automates them).

[GUIDE]How to update from 5.0 to 5.x without loosing data if you're not 100% stock

Instead of having instructions all over the place inside various threads I felt a clear guide should be available as it's own thread. Now since Google implemented this great feature (all hail google) where normal OTA's no longer work on Nexus devices with Android 5.0 that isn't 100% stock i.e. rooted with or without custom recovery a lot of people don't know how to update their devices.
IMO opinion the easiest way without losing any data is to use Fastboot and this is an attempt of a how-to-guide. This is made on a windows PC, probably works with other OS's too.
What you need:
1. You need ADB.exe and fastboot.exe inside an easy accessed folder i.e. put in c:\ADB.
The easiest way to get these are with this tool: http://forum.xda-developers.com/showthread.php?t=2317790
You can also get this by installing the whole Android SDK but that is just a waste of bandwidth and time.
2. You also need to download the latest factory image for Nexus 5. Do this here: https://dl.google.com/dl/android/aosp/hammerhead-lrx22c-factory-0f9eda1b.tgz
3. You might need adb drivers but you'll have to find instructions for this by yourself.
The procedure:
1. Extract necessary files. The factory image you'll download is named hammerhead-lrx22c-factory-0f9eda1b.tgz
This is an archive which can be opened with an extractor of your choice e.g. 7-zip
Inside this archive is another file with no file type extension. Extract this file and rename it to whatyouwant.zip since it's a regular zip file. Then extract all files within this file (very meta with zips inside zips inside zips etc).
The files you need for updating with fastboot are:
system.img
boot.img
radio-hammerhead-m8974a-2.0.50.2.22.img (rename this to radio.img for more convenience)
put all these files in the ADB folder (it will make things easier).
2. plug your phone to your PC. You need to have USB debugging activated in developer mode.
3. open a command prompt and orient yourself to the adb folder (c:\ADB)
4. type adb reboot bootloader and wait until your phone is in bootloader mode.
5. type fastboot flash system system.img and wait until it's finished.
6. type fastboot flash radio radio.img
7. type fastboot flash boot boot.img
8. reboot your device (type fastboot reboot).
Hopefully this will work and you will update without loosing any data. Then you can proceed with rooting, flashing custom recovery etc. This is easiest done with WUG nexus root toolkit (http://forum.xda-developers.com/showthread.php?t=2389107)
I couldn't find any other guide's but if there's already one please remove this.
Just a note, you don't need adb.exe at all, and the drivers are actually USB drivers.
Its also worth noting that 95% of us prefer to recommend users not use toolkits.
Also, you could simply say:
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash radio radio.img
...then point them to the existing adb and fastboot thread which would have saved you writing all the installation stuff out.
Thanks for the guide @mertzi. I've just used to upgrade my Nexus 5 to 5.0.1 without any loss of data. I appreciate the help!
rootSU said:
Just a note, you don't need adb.exe at all, and the drivers are actually USB drivers.
Its also worth noting that 95% of us prefer to recommend users not use toolkits.
Also, you could simply say:
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash radio radio.img
...then point them to the existing adb and fastboot thread which would have saved you writing all the installation stuff out.
Click to expand...
Click to collapse
Do I still use "fastboot flash radio radio.img" even though the radio image from the tgz file is "radio-hammerhead-m8974a-2.0.50.2.22.img"?
optoisolator said:
Do I still use "fastboot flash radio radio.img" even though the radio image from the tgz file is "radio-hammerhead-m8974a-2.0.50.2.22.img"?
Click to expand...
Click to collapse
No. The 4th section is the file path and location.
So this keeps user data? Just updated the system to 5.0.1?
Maintains root and all?
Sent from my Nexus 5 using XDA Free mobile app
Keeps user data but you will have to re-root.
Thank you, thank you, thank you.
I've spent last couple days trying to make heads or tails out of other "tutorials". Some of them linked the OTA update and gave instructions for full image, others gave instructions but lacked the links to the image. I am surprised that none of my searches took me here until today.
Thanks a lot for this guide I was ale to update to 5.0.1 thanks to this guide.
Can I use this method to update from 4.4.4 to 5.0.0 ?
... Not aire if you can jump from 4.4.4 to 5.0 this way...
I actually jumped flashing radio and baseband and THEN flashing CM12.1

Rotted, Team win, er how to update to 5.1?

pretty much says it all, its been a long long time since ive flashed anything ( and the last time i did something it didnt exactly go to plan )
Ive got a Nexus 5 (32GB) its rooted with team win recovery and i would like to update it to the latest version, preferably without losing any data
ive tried searching but there doesn't appear to be a simple guide on how to do this
any help would be greatly appreciated thanks.
There's a whole thread on ota's in the general forum. Start there. You have a number of different options. It would also help to know what android version you're on now.
Sent from my Nexus 5 using XDA Free mobile app
Your Nexus 5 is rotted?
Its not rotted yet, however my typing skills probably have.
Android version 5.0.1
just tried downloading the OTTA update and renaming it as update.zip
then adb sideload with adb sideload update.zip
then error : closed
and thats that.
the guides says this:
Scenario #2
You are stock, with root. Custom Recovery without any modifications or deletions.
Continue to Section B
Click to expand...
Click to collapse
OK, so on to section B as advised
Section B says
Section B: Flashing in a Custom Recovery (TWRP- CWM)
(For Flashing 4.4.4 OTAs and Below ONLY!)
1) Download the OTA.zip and copy to your phone.
2) Boot into recovery.
3) Flash the OTA just like you would a ROM.
4) Reboot.
Click to expand...
Click to collapse
Im on 5.0.1 so thats that out of the window
Download the latest Factory image.
Download the Android SDK.
Boot into bootloader (Vol- & Power). Connect the phone to your Computer. Check for exclamation marks in device manager.
If there are some install the drivers. If there are none extract the contents of the SDK. Copy the contents of the extracted factory image into the same folder (into platform-tools).
Open up the command prompt, by typing "cmd" into the search in the start menu. Once you are in cmd you can change the current folder with "cd" (cd .. gets you out of the current folder and into the above one, path wise / cd foldername enters a folder). "dir" lists the contents of the current folder.
Navigate to your SDK, into the platform tools folder.
Open the flash_all.bat (DO NOT DOUBLE CLICK, do a right click select edit). Type these commands one after the other (just the stuff starting with fastboot). So you flash the new bootloader, reboot, flash radio etc.
The latest fastboot has a "-w" in it. Leave that "-w" out, otherwise you will wipe your device.
Congrats, you flashed a factory image.
If you only want to flash parts of the "image-hammerhead.zip", extract it. It will have several .img files. You can flash these with "fastboot flash "image Type (system/recovery/data)" "filename.img" (without "" of course).

Categories

Resources