[Q] How to undo the kernel patch from CFAR's initial method? - Nexus 5 Q&A, Help & Troubleshooting

I put LRX21O on my N5 by sideloading the factory image (incl the fresh cache and userdata images). Worked fine!
I used ChainFire's first(?) Lollipop Autoroot package. I don't see a version in there, but all its files are dated 11/14. As I understand it, that method needed to patch the kernel to keep root.
His new package (as of 11/25) uses another method, allowing the kernel to remain stock. I did not run the new CFAR, but I let SuperSU update from the market and update the SU binary ("normal" method, not booting into recovery).
My questions:
Did that also undo the kernel patching from the earlier root retention method?
If not, how do I go back to the stock kernel without losing any data?
Thanks! Hope these aren't dumb-ass questions.

Well as far as I know Cf auto root just booted into another customised kernel by chainfire and then rooted the system. It didn't flash a new kernel. Maybe he changed the ramdisk. Not sure about that. But since nothing got flashed I doubt he changed even that.
On how to flash stock kernel just use flashify to flash the img or do it using fastboot.
Code:
fastboot flash boot boot.img

My understanding is that the ramdisk was changed, so that means the boot partition has been edited.
I just did a fastboot flash of the image:
Code:
fastboot flash boot boot.img
If you're really concerned, you can also flash system and re-root using the newer SuperSU ZIP. Flashing boot or system doesn't wipe data. I didn't bother with re-flashing system. No ill effects as far as I can tell.
Code:
fastboot flash system system.img

I've just flashed boot and system.
Then I had to reflash twrp.
Finally SuperSU. All working fine

Related

[Q] Rooting without changing recovery

I want to root the phone but keep the stock CM 11s and the stock recovery so OTAs continue to work. fastboot boot recovery.img doesn't seem to work any more and the towel root vulnerability is fixed in CM. Suggestions?
thats not the right fastboot command to flash a new recovery, but you dont need a different recovery to root.
The Jack of Clubs said:
thats not the right fastboot command to flash a new recovery, but you dont need a different recovery to root.
Click to expand...
Click to collapse
Can the OPO be rooted from stock recovery?
I've not seen the stock recovery yet, but does it have CWM functions in it?
donalgodon said:
Can the OPO be rooted from stock recovery?
I've not seen the stock recovery yet, but does it have CWM functions in it?
Click to expand...
Click to collapse
no. but thats if you choose the recovery root method. root consists of two parts, a su binary that gives normal users full device write control, and a superuser app that allows android apps to use the su binary. when you use recovery to root, it just flashes these two files to the system partition and you have root. its a failsafe method, but requires you to use a custom recovery that lets you flash whatever you want to the phone. since ota updates use the stock recovery to update, if you replace the stock recovery you cant install ota updates. there are other methods that use fastboot and adb usb debugging exploits to copy the root binary to system, but i havent looked into what works. i planned to do that after i get my oneplus.
i used cf-auto-root on my brothers nexus 5. it keeps stock recovery in place, and uses fastboot to root. ota updates still work after that. however you loose root everytime you update because it wipes and flashes a new system partition. not that big a deal, you just reroot after updates. it would do that whether or not you were to replace recovery. the only way around that is to use a prerooted rom that would include root in the system image. cyanogenmod has their own superuser app thats just not included in this rom so they can get google certification. i imagine they have some way to get it installed easily.
I just did the fastboot boot recovery.img and flashed SuperSU fine...
Chinese 64GB..
Sent from my One using XDA Free mobile app

Droid Turbo XT1254 5.1 Rooted Images (+Xposed, other extras) UPDATED 10/10

This is only for devices currently on 4.4 or rooted 5.1 w/ moforoot. This upgrade path allows moforoot to continue to work, and retains the ability to downgrade to 4.4.
Note 12/2/2015:
Development on this has been discontinued with the release of the SunShine bootloader unlock.
To use SunShine without having to deal with KingRoot, you can flash the Rooted v3 system img and then use SunShine to unlock. This is the most stable method if you can use mofo.
After unlocking using SunShine, please flash the latest bootloader/radio images from here. This will bring your phone completely up to date and provide a more stable experience with custom ROMs.
These images are still flashable after unlocking your bootloader if you'd like a stable, closest-to-stock ROM possible.
Instead of using mofo to flash the system image, you can just use
Code:
fastboot flash system filename-goes-here.img
You can then flash your own tweaks like Xposed.
I'd recommend making a back up of the stock ROM in TWRP so you have a stable base to go back to if anything goes wrong.
Note 10/10/2015:
Updated all images to the latest OTA update (SU4TL-44) and included the latest official Xposed version (v75) in extras v5.
Follow the instructions with 5.1_images_v4.zip to flash the updated firmware images.
Note 9/5/2015:
Updated extras (v4) to include the latest official Xposed version (v73). Read the previous note for more information.
Note 8/31/2015:
Updated extras to the latest official Xposed version (v72). Reflashing all of the images is not required, only the extras system.img using mofo.
You can download the full extras image (1.5gb), or if you already have the rooted v2 image, use the extras v3 patch (8mb) with the instructions below.
Using the rooted v2 image + patch will allow you to update in the future without redownloading the entire image (as long as you keep the original after patching).
Note 7/23/2015:
Updated to the latest OTA (23.11.39). Make sure to follow instructions and reflash all images from the latest zip.
Unfortunately, I couldn't provide a patch to go from rooted image v1->v2, so a redownload is needed.
When applying the latest extras, make sure you're applying it to the rooted image v2.
Files (updated 10/10/2015 w/ latest OTA & extras v5)
5.1 firmware images (v4)
SHA1: 8be8a19664e6ba5aa556838bb3f744cdbf41f2ef
Stock 5.1 system image (v3)
SHA1: 1e67fc22331f035e9f3bd6c28d81fb173dd86a3e
Rooted 5.1 system image (v3)
SHA1: b8ff04d7f6ad9de31292cf62da94a3d80d3e373c
Extras 5.1 system image (rooted v3 + extras v5) (see below for details)
SHA1: 126744919f86132c05d15e79373ea759f74e37cf
Instructions
A data wipe is not required, but please back up any important data beforehand in case something goes wrong.
After extracting 5.1_images_v4.zip, reboot into bootloader and run the following commands to prepare your phone for the latest 5.1 system image:
Code:
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash modem modem.img
fastboot flash mdm1m9kefs3 fsg.mbn
fastboot erase mdm1m9kefs1
fastboot erase mdm1m9kefs2
fastboot flash recovery recovery.img
fastboot erase ddr
fastboot reboot-bootloader
Then use mofo to flash the system image of your choice and reboot.
After flashing a system image, the first boot will stay on the Motorola logo for an extra 30 seconds to 1 minute. This is rebuilding the cache partition (erased by moforoot after every flash).
If your phone doesn't boot after 5 minutes (and isn't showing the "Upgrading apps" dialog), try formatting the cache in recovery by doing the following:
While phone is off, hold the volume down button and turn it on to boot into bootloader. Use the volume keys to find the recovery option and press power to confirm.
Once you see the dead Android (it may also say "No Command", this is normal), pull up the recovery menu by holding power and pressing volume up (5.1 recovery is different than 4.4) and use the wipe cache option.
If the screen is blank in recovery with a periodically flashing Android icon, try booting the phone normally and trying again. This happened to me a few times, and I theorize it's because of the cache partition not being formatted after erased.
Extras (updated 10/10/2015 w/ latest OTA & Xposed official v75)
Download patch (v5)
SHA1: 451be2eef3df509facf16b807c6fc665c8fac090
If you don't want to deal with patching the image using xdelta3, you can download the full extras image in the Files section above.
This will prevent you from updating without redownloading the whole image in the future, but is easier for less experienced users.
Current extras:
Xposed official v75 (download APK from here)
(optional) ad blocking
busybox/sqlite3
tethering enabled
To apply the patch, use the rooted v3 image (not an already patched image) as a base, and follow the patching instructions (using xdelta3) in this post.
After patching the system.img with the extras, you'll use mofo to flash the patched image.
To use ad blocking, download AdAway (available in F-Droid) and enable it. Make sure the "Target hosts file" is set to "/data/hosts" in settings.
shouldnt we also be updating the radio?
diabl0w said:
shouldnt we also be updating the radio?
Click to expand...
Click to collapse
I haven't personally tested upgrading the radio, and whether that affects downgrading at all. If someone confirms it's without risk, I'll add the radio.img to the zip and instructions.
firstEncounter said:
I haven't personally tested upgrading the radio, and whether that affects downgrading at all. If someone confirms it's without risk, I'll add the radio.img to the zip and instructions.
Click to expand...
Click to collapse
ive downgraded radio from 4.4 to 4.2 in the past, but it messed up wifi somehow... isnt wifi part of the modem image? anyways, nothing else bad happened so idk if this is useful info
edit: when i did the downgrade (4.4.4 to 4.4.2 radio) it disabled the ability to turn on wifi and log messages gave the error wifistatemachine: failed to load wifi driver
diabl0w said:
ive downgraded radio from 4.4 to 4.2 in the past, but it messed up wifi somehow... isnt wifi part of the modem image? anyways, nothing else bad happened so idk if this is useful info
Click to expand...
Click to collapse
It looks like radio is just a collection of the modem images, so that should eliminate some of the commands. I'll update the OP.
firstEncounter said:
It looks like radio is just a collection of the modem images, so that should eliminate some of the commands. I'll update the OP.
Click to expand...
Click to collapse
check my edit
diabl0w said:
check my edit
Click to expand...
Click to collapse
Radios won't be compatible across ROM versions. You would flash the 4.4.4 radio if downgrading to a 4.4.4 image, not while running 5.1.
Ummmmm. Is this a dream? Someone pinch me...... There's no one around....... Can this really be true!? I'm afraid to try it and bork everything.
firstEncounter said:
This is only for devices currently on 4.4, requires moforoot. This upgrade path allows moforoot to continue to work, and retains the ability to downgrade to 4.4.
Files:
5.1 upgrade images
Stock 5.1 system image
Rooted 5.1 system image
After extracting the 5.1_images_v2.zip, run the following commands to prepare your phone for a 5.1 system image:
Code:
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash radio radio.img
fastboot erase ddr
(Commands based on this post. Thanks @mikeoswego and @JulesJam!)
Then use mofo to flash the system image of your choice.
Xposed and Adblock images coming soon.
Click to expand...
Click to collapse
Why aren't you flashing 5.1 recovery?
JulesJam said:
Why aren't you flashing 5.1 recovery?
Click to expand...
Click to collapse
Missed that command in the OP. Thanks!
Is the rooted image debloated
Sent from my XT1254 using Tapatalk
JulesJam said:
Why aren't you flashing 5.1 recovery?
Click to expand...
Click to collapse
So we should do that command as well?
janitorjohnson said:
So we should do that command as well?
Click to expand...
Click to collapse
I had trouble when I tried to stay on 5.0 recovery after I flashed 5.1 system image on my MX14.
JulesJam said:
I has trouble when I tried to stay on 5.0 recovery after I flashed 5.1 system image on my MX14.
Click to expand...
Click to collapse
Is that the final command?
trikotret said:
Is the rooted image debloated
Sent from my XT1254 using Tapatalk
Click to expand...
Click to collapse
No, it's completely stock with SuperSU installed.
janitorjohnson said:
Is that the final command?
Click to expand...
Click to collapse
I do
logo
boot
recovery
radios
But I do that b/c that is the way they are usually written in the scripts that come with the images. I think the only 2 where the order really matters is the bootloader and partition table and you aren't flashing those.
---------- Post added at 05:18 AM ---------- Previous post was at 05:16 AM ----------
firstEncounter said:
No, it's completely stock with SuperSU installed.
Click to expand...
Click to collapse
I went ahead and made one too just in case there were any issues with FirstEncounter's since I already have a device set up to do this anyhow.
https://www.dropbox.com/s/rmuev8agm5wl2lh/XT1254_5.1_root_system_ext4.zip?dl=0
PLMK if there are any issues with my image. I will take it down once people have started to modify the images, test them and are sure there are no issues.
It should be easy for someone to modify the buildprop so you can have free tether.
works like a charm
firstEncounter said:
This is only for devices currently on 4.4, requires moforoot. This upgrade path allows moforoot to continue to work, and retains the ability to downgrade to 4.4.
Files:
5.1 upgrade images
Stock 5.1 system image
Rooted 5.1 system image
After extracting the 5.1_images_v2.zip, run the following commands to prepare your phone for a 5.1 system image:
Code:
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash radio radio.img
fastboot flash recovery recovery.img
fastboot erase ddr
Then use mofo to flash the system image of your choice.
Xposed and Adblock images coming soon.
Click to expand...
Click to collapse
Followed instructions to a T and used OP's files... Everything works like a charm and is buttery smooth: http://imgur.com/ZwIRB8X
Bootloader acted a little weird, got a couple screen flickers... not sure if related or not. It worked itself out after one or two reboots. Thanks for the awesome instructions!
Just updated the OP with a patch for Xposed, ad blocking, busybox and tethering. Let me know if it works for everyone.
firstEncounter said:
Just updated the OP with a patch for Xposed, ad blocking, busybox and tethering. Let me know if it works for everyone.
Click to expand...
Click to collapse
Thank you! You are working mighty quickly I must say. We all really appreciate it!
I can not seem to boot it to recovery after doing the steps in OP. Little man blinks and says "no command" under him. Wanted to do a factory reset after the steps in OP. Any ideas? I am letting it boot into LP for the first time and then will try to get into recovery to do the reset.
After I let LP boot up, I could enter into recovery and factory reset without a problem.

How do I update rooted shield tablet to marshmallow?

OK, so I have a shield tablet that is running a rooted stock android version 5.1.1 and I want to update it too marshmallow and retain root. I have TWRP as my recovery. What's the easiest way to update? I found a thread for updating to marshmallow and it said it had the auto update file removed (which is good) but the downloadable files were removed from the thread by the OP... I should mention that this tablet is the newer recall replacement tablet that I'm trying to update, and that I still have the old recalled tablet with the auto update file removed so it never got killed. I'm not updating the old one though, just the new one.
You have to take care, not to overwrite the recovery partition. At least for the K1 there is an MM stock ROM on the official website. The version for linux simply contains partition images and a script, which fastboot flashes those. Commenting out the line which flashes the recovery would do the trick.
I'm not sure though if there is a similar ROM for the original.
Ah... no, with a locked bootloader it's slightly more complicated, since a 5.x twrp won't start on with a 6.0 staging blob.
Ok. Assume you've got the partition images. You have to (fastboot) flash everything but the blob and recovery first. Then boot into TWRP (the rom does not boot now) and flash your favorite SU tool. Then fastboot flash the blob. Now the rom should boot and give you root access. Finally update Twrp to 3.x.
njhuiz said:
You have to take care, not to overwrite the recovery partition. At least for the K1 there is an MM stock ROM on the official website. The version for linux simply contains partition images and a script, which fastboot flashes those. Commenting out the line which flashes the recovery would do the trick.
I'm not sure though if there is a similar ROM for the original.
Ah... no, with a locked bootloader it's slightly more complicated, since a 5.x twrp won't start on with a 6.0 staging blob.
Ok. Assume you've got the partition images. You have to (fastboot) flash everything but the blob and recovery first. Then boot into TWRP (the rom does not boot now) and flash your favorite SU tool. Then fastboot flash the blob. Now the rom should boot and give you root access. Finally update Twrp to 3.x.
Click to expand...
Click to collapse
Oh OK, thanks. I think I'll just wait. I'd rather flash a community stock/rooted rom. I don't want to flash an official ROM and have to re-root and flash recovery and all that... That's all just too much work right now just for marshmallow lol. My 5.1.1 is working fantastic so I'll just leave it for now. I'm curious why its so complicated now though with MM? I don't ever remember any previous build jumps requiring so much work to update to... My nexus 5 wasn't difficult at all. I just downloaded the full rom zip (MM Cataclysm cause I was on Lollipop Cataclysm), booted into TWRP, dirty flashed the zip, and it was good to go. I'm looking for THAT kind of update for my shield tablet.
If you unlock your bootloader (which is recomended for using custom roms), then getting root is simple, since you can fastboot flash any partition image.
Independend of your currently installed rom you can always get root by
1. (fastboot) flash the correct (2.7.x for Android 5.x, 3.x for Android 6.x) TWRP recovery
2. boot into TWRP an install a current SuperSU zip.
On the shield tablet you need to flash a new staging blob for MM in any case.
Been awhile
njhuiz said:
If you unlock your bootloader (which is recomended for using custom roms), then getting root is simple, since you can fastboot flash any partition image.
Independend of your currently installed rom you can always get root by
1. (fastboot) flash the correct (2.7.x for Android 5.x, 3.x for Android 6.x) TWRP recovery
2. boot into TWRP an install a current SuperSU zip.
On the shield tablet you need to flash a new staging blob for MM in any case.
Click to expand...
Click to collapse
I am attempting to update to marshmallow as well so i can install kali nethunter 3. but i am unfamiliar with rooting i havent done it since 2010. where would i acquire these files that i need to flash to the shield?

Moto X Pure Edition XT1575 -- systemless root -- OTA updates fail

TWRP 3.0.2-0
SuperSu Pro 2.78
Android 6.0 Marshmallow build MPH24.49-18
I have systemless rooted my phone as per the instructions at http://forum.xda-developers.com/mot...t-moto-x-style-xt1572-br-marshmallow-t3259380
although, it didn't work without some tweaking... Unfortunately I don't remember what steps I took to get it working.
I am not sure of the process form here. Now that I have root, am I supposed to flash boot_orig.img permanently or just when I want to update?
I have tried:
fastboot flash boot boot_orig.img
but I loose wifi and can't download.
I have tried letting the OTA fail with the boot.img flashed, then reflashed with boot_orig.img and tried to install the update zip file via TWRP, but that fails.
I made a TWRP backup before I started rooting and for every major step after that, so I can start fresh if need be.
[EDIT]
I noticed on this thread, http://forum.xda-developers.com/showpost.php?p=63197935&postcount=2 , the following comment:
You must absolutely re-flash your stock /system partition, or the separate root instances will interfere with each other. The installer for this experiment will not clean up old root files.
- Flash stock /system (and /vendor and /oem, if present)
- Flash the attached boot image
- Flash the attached SuperSU ZIP in TWRP
Click to expand...
Click to collapse
Could this be the problem? If so, How do I "flash stock /system (and /vendor and /oem, if present)"?
Any help appreciated...

Updating Security Patch, rooting and using TWRP

I'm currently on November's NDE63V with root and twrp installed. I updated to SR5 root when it was released using TWRP and it boot looped. I assumed it was because I didn't flash the stock boot.img(both slots?), boot to TWRP, flash TWRP then install root. Is this correct? Does that method need to be followed every time there's an update?
I want to update to 7.1.1, December's OTA -> I want stock ROM on one slot and WETA on the other. Both with root. Of course either Franco or ElementalX. Can someone outline the steps, as I don't want to boot loop again, setting everything up is a PITA!
http://forum.xda-developers.com/showpost.php?p=69834495&postcount=2
This should help you with dual booting.
Haven't read through it all yet as I'd like to dual boot as well. But all I did to update is download all the files Weta has when you go to download the rom (boot, bootloader, radio and vendor.)
I Fastboot flashed bootloader, radio and vendor rebooted to bootloader and flashed weta, elementalx and SuperSU sr5.

Categories

Resources