[Q] restoring just the kernel - Nexus 7 (2013) Q&A

Question, if you are mucking around with kernels and want to restore to stock without doing a full TWRP nandroid restore, can you just restore the boot partition?
Alternatively, how does one pull just the stock kernel (including ramdisk) from the factory image? In the past with other brands its been more convoluted e.g. with HTC I remember in addition to flashing the stock kernel in zip you had to push something in fastboot as well (the ramdisk). Unfortunately I can't find just the stock kernel file(s) in this forum hence asking if it can be pulled from the factory image
Thanks in advance

wintermute000 said:
Question, if you are mucking around with kernels and want to restore to stock without doing a full TWRP nandroid restore, can you just restore the boot partition?
Alternatively, how does one pull just the stock kernel (including ramdisk) from the factory image? In the past with other brands its been more convoluted e.g. with HTC I remember in addition to flashing the stock kernel in zip you had to push something in fastboot as well (the ramdisk). Unfortunately I can't find just the stock kernel file(s) in this forum hence asking if it can be pulled from the factory image
Thanks in advance
Click to expand...
Click to collapse
Hi
If you use Nexus Root Toolkit you can start the program and exists the option Launch and there exists restore stock kernel. I think it can solve your problem but first confirm.

There are stock JWR66N and JSS15J kernels attached to this post:
http://forum.xda-developers.com/showthread.php?t=2415497
boot into bootloader
fastboot flash boot boot.img
done

Need jss15q
Sent from my C6603 using Tapatalk 4

wintermute000 said:
Need jss15q
Sent from my C6603 using Tapatalk 4
Click to expand...
Click to collapse
It is there now.
http://forum.xda-developers.com/showthread.php?t=2415497

That are only .img files and not zImage files.
So only with PC or MAC flashable.

TDO said:
That are only .img files and not zImage files.
So only with PC or MAC flashable.
Click to expand...
Click to collapse
I am not sure what your idea of a zImage file is. These are compressed kernels with compressed root filesytems, which is what a zImage is.
You can flash these in fastboot over a PC or you can use dd to restore the partition while in android. Just make sure you know what you are doing in the latter case and don't overwrite the wrong partition or you can have big issues.

sfhub said:
I am not sure what your idea of a zImage file is. These are compressed kernels with compressed root filesytems, which is what a zImage is.
Click to expand...
Click to collapse
I know what a zImage is and this files can easily be flashed via Recovery (TWRP, ...)
If you know a similar method for .img files you can share it.

TDO said:
I know what a zImage is and this files can easily be flashed via Recovery (TWRP, ...)
If you know a similar method for .img files you can share it.
Click to expand...
Click to collapse
If you compare the md5 of a TWRP backup of the stock kernel against the system.img in my posts, they will be exactly the same. I didn't use TWRP, but used the same method as TWRP. Thus if your definition of a zImage is that it can easily be flashed via Recovery (TWRP, ...)
rename system.img to boot.emmc.win
copy into TWRP dated backup folder
restore in TWRP, check boot, uncheck everything else, disable MD5
If you want to do md5
md5 boot.emmc.win > boot.emmc.win.md5
echo " boot.emmc.win" >> boot.emmc.win.md5

Related

CWM 3.0.2.5 borked, can Heimdall help?

Hello all,
OneClickRoot for CWM 3.0.2.5 from stock Froyo (EC05) no worky.
Seemed to work, as phone booted just fine after running the Run.bat. But then on reboot, no recovery, no boot.
I read drockstar's post in his thread on the new CWM - and he mentioned flashing just recovery via Heimdall. Anyone do this? What is the process? He said to extract the zImage and flash to recovery - but that's real confusing because there's a space for the Kernel (zImage), and there's a space for Recovery in Heimdall.
Any thoughts? Any help? Anything is awesome. Thanks!
That's the exact same thing that happened to me.
In the PIT file devices do have a separate entry for both recovery and kernel, which is why Heimdall provides both options. However in the past I've flashed a kernel just in the Kernel slot and had it appear in recovery mode. Ultimately it's up to the secondary bootloader and not Heimdall (Odin or Kies) where the files end up.
Anyway if you just use the Recovery slot and it works then that's great. However there's no harm in placing the file in both Kernel and Recovery slots.
Nooo, if you place it in Kernel, it flashes to bml7, in recovery it flashes to bml8.. they are both technically kernels. a recovery kernel uses fota.rc, and a bml7 (normal) kernel uses init.rc. you DO NOT want to flash a recovery kernel to your bml7, i believe DRockstars cwm3.0.2.5 wont break your phone, but it wont be what you want, its a minimaist kernel. you will lose whatever features you have from whatever kernel you have (twilight zone, genocide, clean kernel, etc) just place the zImage in recovery and thats it. or rename it to recovery.bin and use odin.
chris41g said:
Nooo, if you place it in Kernel, it flashes to bml7, in recovery it flashes to bml8.. they are both technically kernels. a recovery kernel uses fota.rc, and a bml7 (normal) kernel uses init.rc. you DO NOT want to flash a recovery kernel to your bml7, i believe DRockstars cwm3.0.2.5 wont break your phone, but it wont be what you want, its a minimaist kernel. you will lose whatever features you have from whatever kernel you have (twilight zone, genocide, clean kernel, etc) just place the zImage in recovery and thats it. or rename it to recovery.bin and use odin.
Click to expand...
Click to collapse
Sorry! I don't know much about the individual recovery kernels floating around. I made the false assumption that they all added functionality without removing functionality, hence I figured they couldn't cause problems. Obviously a mistake.
I'm obviously aware there are to different kernel locations on the device. However I have flashed certain kernels to bml7 only in the past and had them end up in bml8 for recovery also (probably a kernel feature now that I think about it). Presumably this is to make up for the fact that Odin doesn't allow you to flash the recovery partition directly.
Anyway the lesson here is to make sure you know the details of the particular kernel you're flashing!
I ended up going the odin routw, but thanks fo the knowledge!
In the future, I will try heimdall again and either go only to recovery and/or rename the file to recovery.bin.
Sent from my SPH-D700 using XDA Premium App
funktron said:
I ended up going the odin routw, but thanks fo the knowledge!
In the future, I will try heimdall again and either go only to recovery and/or rename the file to recovery.bin.
Sent from my SPH-D700 using XDA Premium App
Click to expand...
Click to collapse
Slight correction so that other readers don't get confused. Renaming a file will make no difference in Heimdall. Heimdall intentionally allows any filename to be used. Placing a file in the Recovery slot will result in the file ending up on the device as a recovery kernel. Hence your existing "regular use kernel" will not be modified.
However Odin does look at filenames and matches these to entries in a PIT file. As most PIT files don't contain a separate filename for the recovery partition, in the general case Odin will not allow you to upload to the recovery partition only.

How do I backup my stock recovery?

I want to be able to flash my stock recovery when I no longer want TWRP or CWM. How would I go about doing this?
tcmoffitt said:
I want to be able to flash my stock recovery when I no longer want TWRP or CWM. How would I go about doing this?
Click to expand...
Click to collapse
Hello,
Thanks for using XDA Assist.
What device do you have?
___
v7
XDA Assist
v7 said:
Hello,
Thanks for using XDA Assist.
What device do you have?
___
v7
XDA Assist
Click to expand...
Click to collapse
HTC One m8 Tmobile
Thanks for the help guys I really appreciate it. This forum is just so helpful............. ---____---
Which T-Mobile ?
If it is T-Mob US .. there's a dedicated section for T-Mob US and you can find any info there.
tcmoffitt said:
Thanks for the help guys I really appreciate it. This forum is just so helpful............. ---____---
Click to expand...
Click to collapse
This is not possible to backup your stock recovery. When you need that you can download it simply (base on your phone's build number). Also you can extract stock recovery frome your ota zip update(the file with img format inside of firmware folder)
Arsinn said:
This is not possible to backup your stock recovery.
Click to expand...
Click to collapse
Actually, the following usually works:
This has to be done before flashing custom recovery. Unlock bootloader, then fastboot boot recovery.img
With "recovery.img" being a TWRP file located in your fasboot folder. This will boot into TWRP without actually flashing it. From there, you can pick recovery in the backup options, to backup stock recovery.
But yes, I agree that stock recovery images are pretty easy to obtain from these forums, or extracting from a OTA or ROM.zip.
redpoint73 said:
Actually, the following usually works:
This has to be done before flashing custom recovery. Unlock bootloader, then fastboot boot recovery.img
With "recovery.img" being a TWRP file located in your fasboot folder. This will boot into TWRP without actually flashing it. From there, you can pick recovery in the backup options, to backup stock recovery.
But yes, I agree that stock recovery images are pretty easy to obtain from these forums, or extracting from a OTA or ROM.zip.
Click to expand...
Click to collapse
Hi, redpoint73...
Maybe I'm missing something here, but I'm not seeing an option to backup the Recovery in TWRP 2.8.7.0... Just Boot, Cache, System, Data and Android Secure are available (see attached screenshot). I remote booted TWRP from my laptop, as I did when I rooted Marshmallow around a fortnight ago, in order to keep the stock recovery intact.
It would certainly be useful to be able to backup the stock recovery via TWRP... I just haven't found a way of accomplishing it .
-----
But a possible option to backup the stock recovery would be to use the Flashify app...
Remote boot TWRP from your PC, acquire root, and then run Flashify...
Flashify PlayStore link...
https://play.google.com/store/apps/details?id=com.cgollner.flashify
XDA discussion thread...
http://forum.xda-developers.com/showthread.php?t=2349847
This app uses <dd=if/of> commands to backup and potentially restore the boot and/or recovery images.
Although it does require root to work.
I've used Flashify on my Nexus 7 and Nexus 9 in the past, but never on my M8, except to backup... never to restore, so I cannot personally vouch for it's safety on the M8.
-----
What I'm unsure of about Flashify...
@redpoint73, @ckpv5, maybe you guys could shed some light on this...
Would such a <dd=if/of> created backup of stock recovery be flashable via fastboot?
And would it be safe to do so?
I know that TWRP uses <dd=if/of> commands, having looked through TWRPs logs... but I'm not quite sure how fastboot works when it comes to flashing stuff, and I'm very wary about doing it myself or recommending it for others.
Normally, you'd just use the Flashify app to restore any recovery/boot.img backups you've previously made...
But Flashify requires root to work, and with an unrooted system, this is isn't viable. So could one use fastboot in the normal way to flash such a previously made backup of the stock recovery?
-----
Anyhow, it's not critical at the moment for me, because I've not flashed TWRP to my M8, my stock recovery remains intact.
-----
I would recommend anybody reading this seeking to root their Marshmallow M8 to just remote boot TWRP from their PC with fastboot boot twrp.img (ie., don't actually flash it), perform an unrooted Nandroid backup first...
...and then flash Chainfire in the usual way.
This leaves the stock recovery intact, which will be required for future OTAs.
And there still might be some...
My Nexus 9 receives monthly security patches from Google (probably after the StageFright debacle of last year), and it may well be that the M8 will also continue to receive security patches, despite it being nearly two years old.
So you need to be ready... with an unrooted/untouched Nandroid of your own creation and the stock recovery.
I know that Chainfires systemless root method is supposed to address this issue, but if you're going to mess with system, you should have a Nandroid backup anyway...
...just in case.
Rgrds,
Ged.
Funny, I use the fastboot boot option to boot into TWRP saving my original recovery.

Moto E4 Plus Stock Images (owens NPR26.58-25)

Here's a link to the important stock stuff for the Qualcomm Moto E4 Plus. Specifically the boot.img, recovery.img, system.img, fsg.bin, logo.bin, and modem.bin.
I'm too new to post links, but just go to tinyurl dot com /yauppmbc
I'm not 100% sure if system.img will flash correctly, but using
Code:
dd if=/sdcard/system.img of=/dev/block/mmcblk0p53
should work, just remember to put the system.img in /sdcard first. Also included in the zip is the partition mappings. I used dd to yank them from the phone while booted into TWRP. Huge shout out to @jasonmerc for walking me through this.
My build number is NPR26.58-25
Clickable link here
Can I just flash the zip
On my phone from TWRP ?
Miklalo said:
On my phone from TWRP ?
Click to expand...
Click to collapse
TWRP might work, but you need to set it to image flashing rather than zip flashing
jasonmerc said:
TWRP might work, but you need to set it to image flashing rather than zip flashing
Click to expand...
Click to collapse
I downloaded the zip twice and both times was unable to extract the zip file. Do I need a specific app or program to extract this to access the .img files in it?
Sent from my XT1775 using XDA Premium HD app
glockman4519 said:
I downloaded the zip twice and both times was unable to extract the zip file. Do I need a specific app or program to extract this to access the .img files in it?
Sent from my XT1775 using XDA Premium HD app
Click to expand...
Click to collapse
It's corrupted somehow. It's just a normal zip, nothing special should be needed.
aj2333 said:
It's corrupted somehow. It's just a normal zip, nothing special should be needed.
Click to expand...
Click to collapse
Thanks for letting me know, I'll see if I can reach maerk and tell him to make a new zip
Great, I made a build of Resurrection Remix 7.1.2 for the XT-1775 (Owens) and have no data. I noticed that there are no APN's in the carrier section under settings. It also has no way to add in any new APN's. My guess is that I will have to flash the modem.img and maybe a few more to get this working again. I'm hoping that I don't have to go back to completely stock...lol...

Extract stock kernel from OTA's or Full Images

Does anyone know how to extract the stock kernel from the OTA/Full images downloaded from Google's servers for our device? Additionally, is there a way to make it flashable zip through TWRP? Thanks.
Sent from my Pixel 2 XL using Tapatalk
andrewjt19 said:
Does anyone know how to extract the stock kernel from the OTA/Full images downloaded from Google's servers for our device? Additionally, is there a way to make it flashable zip through TWRP? Thanks.
Click to expand...
Click to collapse
Use a program like 7zip or Winzip to extract the factory image. Then, you'll see another large zip, extract that one too. Then inside you'll see the boot.img which is the kernel and recovery in one. Take that boot.img and put it on your internal storage. Boot into twrp, select install, then select image on the bottom right, then go to where you put the boot.img, tap it, then select the boot partition to flash it to. Takes about a second and it's done. Now your on stock kernel again. Keep in mind, that you'll have to flash the twrp.zip again when your done. Also, be sure to remove all lock screen security before you start all of this. I'm sure you know about that already though ?

Question Before TWRP flash...

How we can find recovery that needs to be backup? I have already gone to:
CMD
adb shell
su
cat /proc/mtd <- That where got error by (cat: /proc/mtd: No such file or directory)
So, any idea?
What? Recovery is the boot.img?
habobababo said:
What? Recovery is the boot.img?
Click to expand...
Click to collapse
Good try! it's recovery.img
cat139lyleb said:
Good try! it's recovery.img
Click to expand...
Click to collapse
Why would you want to backup a recovery? Also, the recovery is BOOT.img, not recovery.img
There are devices with separate recovery partition, recovery.img but it's not the case with Oneplus 9 Pro. Recovery is "baked" in kernel ("boot.img")
boot.img is NOT a recovery image!
The biggest reason why I need stock recovery backup in case TWRP isn't working for this kind of model
There is no separate recovery.img (partition) on Oneplus 9 pro. Why don't you root your handset and check yourself using partitions backup and restore by Wanam?
Wanam? what it is?
There is no separate recovery partition on devices that have A/B partitions like the 9 series, it's part of the boot image.
Understood. Thank EtherealRemnant, for explaining a straightforward answer.
Then how can we backup the whole?
cat139lyleb said:
Understood. Thank EtherealRemnant, for explaining a straightforward answer.
Then how can we backup the whole?
Click to expand...
Click to collapse
You can root and use the Partitions Backup tool from the Play Store as mentioned but I'm not sure what you're wanting to back up. I never backed up any partitions on my 9 and I have flashed custom ROMs, different region OxygenOS, and even ColorOS to it without having any issues that I couldn't fix with the MSM Tool.
Have you ever had a param preload error with the MSM tool?
TheGhost1951 said:
Have you ever had a param preload error with the MSM tool?
Click to expand...
Click to collapse
Param errors are common when trying to use mods to flash T-Mobile variants for some reason.

Categories

Resources