So after much flailing, I think I understand how to manage updates... but I'm not sure. I currently have root and Xposed installed on 5.1.1.
My plan when the next update comes:
get the factory image from google
Unzip the zip.
Inside that, there is the image-shamu zip, which I'll also unzip.
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash recovery twrp-xxx-shamu.img
from twrp
Reroot and reboot
boot back to recovery and install Xposed again.
Is that about right? what am I missing here?
ninjaaron said:
So after much flailing, I think I understand how to manage updates... but I'm not sure. I currently have root and Xposed installed on 5.1.1.
My plan when the next update comes:
1. get the factory image from google
Unzip the zip.
Inside that, there is the image-shamu zip, which I'll also unzip.
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash recovery twrp-xxx-shamu.img
from twrp
Reroot and reboot
boot back to recovery and install Xposed again.
Is that about right? what am I missing here?
Click to expand...
Click to collapse
That would work though no need to flash recovery if you already have it.. But yes, other than that, probably the best way.
Edit, also no need to reboot between flashing SuperSU zip and Xposed zip
Thanks. The last time I tried to flash system.img, twrp was bork'd, but maybe it was just a fluke. I did a lot of weird things today to figure this stuff out, and maybe it was something else.
Related
All,
I'm coming from a nexus environment where I've been able to do fastboot boot twrp-2.6.3.1-ghost-4.4.img rather than fastboot flash recovery twrp-2.6.3.1-ghost-4.4.img since I'm hoping to keep the stock recovery while installing supersu. It complains about "(bootloader) Command restricted" with the MotoX even though my bootloader is unlocked. Is this typical of Moto devices? Do I actually need to flash twrp, then supersu and then the stock recovery if that's the final result I want? FWIW, I want SU on it but I'd like to also receive future OTA updates w/o too much dorking around of at all possible.
thanks peterb
Are you using mfastboot or just regular fastboot?
I fastboot twrp no problem. I did however mfastboot the system.img . But to answer your question twrp will ask you if you want to root when you go to reboot.
Fastboot flash recovery twrp 2.6.3.1-ghost-4.4.img is the command, when you flash do not reboot the device to the system but boot into recovery instead, you should be good to go and twrp should ask if you wish to root, if not just download the flashable supersu zip
Sent on my Moto X
I understand that you should flash if you want to have TWRP installed on your phone but that's not what I want. I'd like to just boot into TWRP, install the SuperSU.zip and then boot back up as normal leaving the stock recovery in place so that I will continue to get OTA updates. I get that this is likely not the norm but it's what I did with my N4 to get SuperSu so that I could update boot.prop for flashing a hybrid radio. Doing this made it easier to get the phone back to OTA ready w/o having to flash the stock recovery back.
I found a couple of posts in the N4 where the fastboot command failed and you needed to start using the "-c" command. I was wondering if this was the problem I was running into. The argument for -c is a bit cryptic so I worry that the one I found is likely N4 specific:
fastboot -c "lge.kcal=0|0|0|x" boot customrecovery.img
Basically what I'm wondering is if anyone has been able to just boot into TWRP w/o actually flashing it to the recovery partition.
If this is not possible then I'll flash TWRP, root and then flash the stock recovery back on since I did get the stock 4.4 image from Motorola.
thanks peterb
flashallthetime said:
Fastboot flash recovery twrp 2.6.3.1-ghost-4.4.img is the command, when you flash do not reboot the device to the system but boot into recovery instead, you should be good to go and twrp should ask if you wish to root, if not just download the flashable supersu zip
Sent on my Moto X
Click to expand...
Click to collapse
Interested in this as well, for booting kernels. Device support has been hit-or-miss for me in the past.
And folks, he's asking about fastboot's ability to launch an image _without_ flashing. This is a somewhat esoteric/advanced use.
I'm interested in this too even though I have a locked Moto X.
I didn't know this was possible, huh. As for our device, it'll probably help if we can figure out what that -c command means.
Sent from my Moto-X (GSM DE) using the xda-developers app
thehockeydude44 said:
I didn't know this was possible, huh. As for our device, it'll probably help if we can figure out what that -c command means.
Sent from my Moto-X (GSM DE) using the xda-developers app
Click to expand...
Click to collapse
If I'm remembering right, google took the ability to boot a recovery without loading one away in 4.2. We tried to do this on the HTC 1 Google edition when we pulled its partitions to make a system dump. It failed.
OTA fails when the device is rooted, even if you have the stock recovery.
The OTA zip checks the system partition. If there is any single modification, it fails.
you can just:
- flash twrp to recovery partition
- reboot into recovery
- install supersu
- reboot into fastboot
- flash stock recovery
- reboot to system
you have installed supersu and still have stock recovery -> you can take OTAs
edit: i just read that even with stock recovery, if u are rooted the ota won't work
Yea, this is the other way to do it. It's just a bummer if one can't use the flexibility to just boot into recovery. Note that I still seem to be able to boot into custom recovery on my Nexus 4 that's running KitKat. I'm curious about the comment about not getting an OTA with su installed. I know that with a modified build.prop and radio, the N4 wouldn't update but I could adb sideload successfully once I put build.prop back and the stock radio on. I figured the OTA would just unroot and then I'd have to do the process again.
Anyway, this was my plan B, just would have preferred to boot recovery.
peterb
waiflih said:
you can just:
- flash twrp to recovery partition
- reboot into recovery
- install supersu
- reboot into fastboot
- flash stock recovery
- reboot to system
you have installed supersu and still have stock recovery -> you can take OTAs
edit: i just read that even with stock recovery, if u are rooted the ota won't work
Click to expand...
Click to collapse
if u want to "unroot" to take otas, u can just flash stock system
waiflih said:
you can just:
- flash twrp to recovery partition
- reboot into recovery
- install supersu
- reboot into fastboot
- flash stock recovery
- reboot to system
you have installed supersu and still have stock recovery -> you can take OTAs
edit: i just read that even with stock recovery, if u are rooted the ota won't work
Click to expand...
Click to collapse
I am interested in this as well. How do we get a copy of the stock recovery to reflash?
Also, I have had rooted stock and custom recoveries and have received OTA's before (but they were on Nexus devices).
droiddog said:
I am interested in this as well. How do we get a copy of the stock recovery to reflash?
Also, I have had rooted stock and custom recoveries and have received OTA's before (but they were on Nexus devices).
Click to expand...
Click to collapse
you can take it from the the file used in rsdlite, according to you fw version
The only reason I want the stock recovery is because I think you can't remotely lock or erase your device on a custom recovery. Does anyone know anything to the contrary? Thanks.
I got a NExus 7 wifi 2012 that was running 5.0. It was rooted, and used TWRP.
I got info about the updated and pressed install. Booted in to TWRP and nothing happened. I then pressed install in TWRP and in cache found the .zip and tried to install. Got an error.
I then booted in to android again, and flashed the stock recovery 5.0.2 (I guess it's like the stock 5.0?) and later I tried the OTA install again. Got an error.
I then read about the new "feature" in 5.0 about not allowing OTA if rooted, and I then in SuperSU completely uninstall the root and rebooted.
Later when I got the OTA update again, I thought it should work, but I still got the error.
What can I do? Right now I'm on a MAC. Can I in some way flash only the good stuff from the factory image, and in some way NOT have to factory reset the Nexus 7?
/Söder
Even when you unroot, your file system is tampered. Only way to update is using factory images.
I think you can flash the factory image without user data to prevent factory reset.
theliquid said:
Even when you unroot, your file system is tampered. Only way to update is using factory images.
I think you can flash the factory image without user data to prevent factory reset.
Click to expand...
Click to collapse
How is it I do that then? What files from the factory images (unpacked) is it that I need to flash? Is it fastboot or ADB I use to flash?
/Söder
soder said:
How is it I do that then? What files from the factory images (unpacked) is it that I need to flash? Is it fastboot or ADB I use to flash?
/Söder
Click to expand...
Click to collapse
I have done this with my rooted N5 and N7. You need to re-flash system.
Unpack the 5.0 factory image and
fastboot flash system system.img
goraps said:
I have done this with my rooted N5 and N7. You need to re-flash system.
Unpack the 5.0 factory image and
fastboot flash system system.img
Click to expand...
Click to collapse
I managed to do this now to. My biggest problem is now to root the device again. I've switched back to stock recovery, before I removes root, when I was trying to apply the ota.
Now when I try to flash twrp recovery, I get an error about the size. I can flash the stock recovery though, the same way I flashed system.img and boot.img.
What can be wrong? I do I get root now again?
/Söder
/Söder
soder said:
I managed to do this now to. My biggest problem is now to root the device again. I've switched back to stock recovery, before I removes root, when I was trying to apply the ota.
Now when I try to flash twrp recovery, I get an error about the size. I can flash the stock recovery though, the same way I flashed system.img and boot.img.
What can be wrong? I do I get root now again?
/Söder
/Söder
Click to expand...
Click to collapse
Are you saying you can't flash the TWRP recovery now? So are you now completely stock 5.0.2?
goraps said:
Are you saying you can't flash the TWRP recovery now? So are you now completely stock 5.0.2?
Click to expand...
Click to collapse
Yes, system, boot, recovery flashed with fastboot.
When in fastboot mode, I get error, something with size, when flashing twrp. I found a CWM recovery I could flash, but it didn't boot to recovery correctly.
The twrp file is not corrupt. Tried it again and also a different version.
/Söder
OMG. I'm so f-ing stupid. Blaming all the x-mas food.
Was trying to flash the Oneplus One recovery. Not the one for Nexus 7.
Hope it works better now...
/Söder
When a new Android version is released I like to do a completely fresh install of everything. How do I adjust my routine in the future, to make sure I'm decrypted?
This is what I normally do, with one new step at the bottom, to avoid (?) encryption.
Download the factory image and run the flash-all script.
The phone automatically starts up Android after that. I don't do the setup, but return to the bootloader.
I flash TWRP and immediately reboot to recovery.
I push ElementalX (no force encrypt) and SuperSU to the /sdcard and flash both using TWRP.
New: I reboot to the bootloader and run 'fastboot erase userdata'.
I reboot to system and go through with the setup.
Now my questions are:
Will it work (will I avoid encryption by doing these steps)?
Is it the best way of doing it (most sane, fewest steps)?
Is userdata the only partitition that normally gets encryptet? What about the system partition for example?
EDIT: For future reference. What I suggest here won't work. Look at post #9 for something that will.
you can download bootnoforceencrypt.img rename it as boot.img and overwrite the file and you dont need to flash kernel or smthng else. what i did was that but i followed not flash.all i did it one by one writing down the commands. That is the best and rock solid way. Did that 3 days ago.
Good luck
stokholm said:
When a new Android version is released I like to do a completely fresh install of everything. How do I adjust my routine in the future, to make sure I'm decrypted?
This is what I normally do, with one new step at the bottom, to avoid (?) encryption.
Download the factory image and run the flash-all script.
The phone automatically starts up Android after that. I don't do the setup, but return to the bootloader.
I flash TWRP and immediately reboot to recovery.
I push ElementalX (no force encrypt) and SuperSU to the /sdcard and flash both using TWRP.
New: I reboot to the bootloader and run 'fastboot erase userdata'.
I reboot to system and go through with the setup.
Now my questions are:
Will it work (will I avoid encryption by doing these steps)?
Is it the best way of doing it (most sane, fewest steps)?
Is userdata the only partitition that normally gets encryptet? What about the system partition for example?
Click to expand...
Click to collapse
I want to use the ElementalX kernel anyway, so there's no point in flashing the modified boot image.
So still looking for answers. But thanks.
Download and flash a zip that someone here makes then flash the kernel.
But yeah.
fastboot flash system.img
fastboot erase userdata
fastboot flash userdata.img
fastboot flash radio.img
That's all that's needed. Push SuperSU to sdcard and boot.
rootSU said:
Download and flash a zip that someone here makes then flash the kernel.
But yeah.
fastboot flash system.img
fastboot erase userdata
fastboot flash userdata.img
fastboot flash radio.img
That's all that's needed. Push SuperSU to sdcard and boot.
Click to expand...
Click to collapse
Thanks, but do I still need that zip you're taking about, if I install ElementalX anyway? Isn't boot.img supplied by ElementalX?
And I'm not sure I understand. Would my procedure fail?
stokholm said:
Thanks, but do I still need that zip you're taking about, if I install ElementalX anyway? Isn't boot.img supplied by ElementalX?
And I'm not sure I understand. Would my procedure fail?
Click to expand...
Click to collapse
Forget the zip, I wasn't fully taking into account what you wanted (full wipe)
Your method would work fine but you're doing multiple unnecessary steps, only becoming necessary because you're using the flash-all method.
Flash-all flashes system, userdata, radio, recovery, cache, boot
Then you have to replace recovery and boot.
My method flashes system, userdata, radio.
It leaves recovery and boot as is so nothing more to do then. ...except flash root.
Thanks a lot rootSU. That makes sense. I think I'll use your method.
But theoretically,would I need to flash userdata.img after the erase, like you're doing? With my method that is.
stokholm said:
Thanks a lot rootSU. That makes sense. I think I'll use your method.
But theoretically,would I need to flash userdata.img after the erase, like you're doing? With my method that is.
Click to expand...
Click to collapse
Possibly not. Both should work independently, but we're doubling up here just in case. You could try both. They'll show sdcard though.
Well I ended up trying actually. "fastboot erase userdata" was neither enough nor necessary. Erasing it left me without one, so I ended up in a boot loop. And I found out that "fastboot flash userdata userdata.img" actually runs "erase" prior to the flashing. So this worked as I wanted it to:
Download the factory image and run the flash-all script.
The phone automatically starts up Android after that. Don't do the setup, but return to the bootloader.
Flash userdata.img (again), since it was encrypted during the first boot.
Flash TWRP and reboot to recovery.
Push (adb push) ElementalX and SuperSU to the /sdcard and flash both using TWRP.
Reboot to system. This time userdata isn't encrypted because ElementalX doesn't force encryption.
To start: 5.1.1 (LMY48M), rooted, with TWRP for recovery
For every 5.x update so far, this has been my procedure using fastboot:
Flash boot.img
Flash radio.img
Flash system.img
After successfully updated, I'd use WugFresh's Nexus toolkit to root and flash TWRP.
I'm a fan of not needing to flash userdata.img, as I don't think that should be necessary given that the OTA wouldn't wipe installed apps and such.
I've read other threads about using fastboot to upgrade and am concerned about the boot warnings, which seem to require a custom kernel to circumvent. My question is: will the above approach still work? Do I need to flash any other files? If I need to flash a custom kernel, where do I get it, how do I flash it (is it just a custom boot.img?), and at which point in the flash sequence should I apply it?
Secondly, has anyone tried gaining root through the Nexus toolkit once upgraded to 6.0?
I'm looking for recommendations so I don't spend hours trying to unbrick my device. Thanks!
You'll also want to flash the 6.0 bootloader and why are you using the toolkit to flash twrp when you can flash it in fastboot along with the rest of the files?
Ah OK, I'll flash the bootloader image as well. Anything else to be concerned with? The toolkit has a feature to root + flash twrp as a feature, so I just use that.
Do the bootloader first, then reboot the bootloader before you flash anything else. There are instructions floating around here some where or you can google nexus 6 flash factory images. You don't have to flash user data as this will format all you data/ apps.
Just download the latest SuperSu zip (2.50) and put it on your SDcard. If you flash as you suggested and then boot directly into recovery, you will still have TWRP. If you don't flash the stock recovery.img to replace TWRP, it will replace on first boot anyway, unless you root imeediately, but you are probably booting to use the toolkit, which replaces recovery only to have to use the toolkit to flash recovery anwyay.
So do your flashes, boot straight into recovery, flash the supersu zip on your sdcard. Done.
I accidentally downloaded the OTA. Now it boots into TWRP (3.02) and stops. I can flash a ROM and I can restore a backup but it still boots to TWRP.
Any way to load some system without having to flash stock?
Yeah you can download the stock image, extract it, and "fastboot flash system system.img"
fakecharles said:
I accidentally downloaded the OTA. Now it boots into TWRP (3.02) and stops. I can flash a ROM and I can restore a backup but it still boots to TWRP.
Any way to load some system without having to flash stock?
Click to expand...
Click to collapse
It would be good to know if your problem is resolved - it would save me the effort of typing this, for a start.
The simplest way is to download the OTA to your PC and sideload it. If you're already in TWRP there is a button which allows you to sideload via ADB.
Edit: Sorry, I see you say "not stock". Downloading the OTA doesn't do anything - I guess that you tried to install it? Which ROM were you on before you did this? And you know that there's a newer TWRP - 3.1?
I did resolve it. I found some instruction I could tie in the terminal. Sorry, I don't have a link.