Modifying a custom ROM to use a stock kernel - AT&T Samsung Galaxy S 4 Q&A, Help & Troubleshootin

Is it possible to take a custom ROM that uses a custom kernel and modify it, either by flashing or manually editing the zip file, to use a stock kernel instead?
Just a thought I had to help those with locked bootloaders.

Apoplectic1 said:
Is it possible to take a custom ROM that uses a custom kernel and modify it, either by flashing or manually editing the zip file, to use a stock kernel instead?
Just a thought I had to help those with locked bootloaders.
Click to expand...
Click to collapse
If it uses a TW based kernel, no changes are needed of course. AOSP is different enough that booting it on a locked bootloader stuck on a different kernel is generally accepted as not something to spend time on. Just putting a stock kernel in the ROM zip doesn't help since Safestrap doesn't flash them anyway. In order to make it work, you'd have to make sure everything was set up the way the kernel wants it and calls for things.
Sent from my SGH-I337 running GPE

DeadlySin9 said:
If it uses a TW based kernel, no changes are needed of course. AOSP is different enough that booting it on a locked bootloader stuck on a different kernel is generally accepted as not something to spend time on. Just putting a stock kernel in the ROM zip doesn't help since Safestrap doesn't flash them anyway. In order to make it work, you'd have to make sure everything was set up the way the kernel wants it and calls for things.
Sent from my SGH-I337 running GPE
Click to expand...
Click to collapse
Well damn, thought I was onto something .
I may give writing my own TW based kernel+ROM package a go then.

Related

[Q], kernel help?

Basically I've never flashed a custom kernel before so I'm trying to do some research so if someone could give me some incite or point me in the right direction I'd really appreciate it.
The only thing I'm not sure of is if I flash a custom kernel will it prevent me from receiving any future ota updates? If so, any ideas where to find a flashable stock kernel? I couldn't find one. I really want to stay with the stock rom. Had my fill of custom roms on my phone.
Sent from my Nexus 7
Y u not like roms?!
nick2418 said:
Basically I've never flashed a custom kernel before so I'm trying to do some research so if someone could give me some incite or point me in the right direction I'd really appreciate it.
The only thing I'm not sure of is if I flash a custom kernel will it prevent me from receiving any future ota updates? If so, any ideas where to find a flashable stock kernel? I couldn't find one. I really want to stay with the stock rom. Had my fill of custom roms on my phone.
Sent from my Nexus 7
Click to expand...
Click to collapse
Let's see. AFAIK yes, non-stock kernels will prevent you from getting those long-awaited OTAs (not sure though as the first thing I did after getting my N7 was to flash PA ).
If you really like the stock experience but still want a custom kernel, you must flash a custom recovery to flash kernels. The latest TWRP touch is what you need.
After you've flashed the recovery, just download the kernel zip, reboot to recovery, flash, profit.
As for a kernel, you can go with M-Kernel, DerKernel, franco.Kernel, Faux and so on and so forth. I love M-Kernel personally. You can tweak it with TricksterMOD for a smokin' good overclock as well as purty good battery life
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Also, just asking, what do you mean by a "a flashable stock kernel"? If you already have the stock kernel, why flash the same over it?
AFAIK updates to stock kernel are provided by OTAs.
I guess I was looking for a way to return to the stock kernel if need be. I have my recovery and understand that part. Just trying to make sure I understand kernels better before I brick my n7. Thanks for the help!
Sent from my Nexus 7
i also need a stock flashable kernel..just in cased i wan to revert back...
Sent from both my sexy galaxy nexus and nexus 7 X)
nick2418 said:
I guess I was looking for a way to return to the stock kernel if need be. I have my recovery and understand that part. Just trying to make sure I understand kernels better before I brick my n7. Thanks for the help!
Sent from my Nexus 7
Click to expand...
Click to collapse
Oh, ok. If you flash the stock ROM, it flashes the kernel as well (but it's a lot of work reflashing a ROM just for the kernel )
What you can do is this: extract the stock ROM zip and flash the boot.img you get.
Here's a link to the stock ROM: https://dl.google.com/dl/android/aosp/nakasig-jop40d-factory-efcec044.tgz
Edit: I figured I'd explain the rest as well...
After you download that file, untar it: nakasig-jop40d-factory-efcec044.tgz will untar to a folder probably named:nakasig-jop40d-factory-efcec044
Open that folder. You will find a zip (probably image-nakasig-jop40d.zip or something like that), unzip it.
You'll find four files. boot.img is the one you need. Flash it to your device with fastboot.
If you wan a flashable zip, unzip any custom kernel, replace the awesome custom boot.img with the boring stock one and rezip. You should be able to flash it from TWRP or CWM.
Note that the stock kernel nukes CWM on first boot. I assume you don't have root. Do this:
1. Connect the N7 to your PC. [you should have debugging enabled in dev options]
2. Open an adb shell and type this: mv /system/recovery-from-boot.p /system/recovery-from/boot.p.bak
3. ???
4. Profit
[If you do have root, open a file manager, remount /system as read/write and rename /system/recovery-from-boot.p to something.]
Click thanks if I helped!
That's why I was hoping to find the JOP40D stock kernel as a flashable zip. But I'll give the boot. I'm a shot. Thanks again!
Sent from my Nexus 7
nick2418 said:
That's why I was hoping to find the JOP40D stock kernel as a flashable zip. But I'll give the boot. I'm a shot. Thanks again!
Sent from my Nexus 7
Click to expand...
Click to collapse
I added some stuff, see if it helps.
It would be nice if you clicked "thanks" below my post
stock flashable 4.1.2 kernel for grouper(put up by faux as a "reset" kernel) http://faux.androidro.ms/grouper-faux123-reset-kernel-4.1.2.zip (should be fine on 4.2.1)
flashable in twrp or cwm recovery. no hoops to jump through flashing or after flashing this. it doesnt nuke your recovery.
simms22 said:
stock flashable 4.1.2 kernel for grouper(put up by faux as a "reset" kernel) http://faux.androidro.ms/grouper-faux123-reset-kernel-4.1.2.zip
flashable in twrp or cwm recovery. no hoops to jump through flashing or after flashing this. it doesnt nuke your recovery.
Click to expand...
Click to collapse
Will that work with OP's 4.2.1?
Awesoham said:
Will that work with OP's 4.2.1?
Click to expand...
Click to collapse
yea. i occasionally run a 4.1.2 trinity kernel on my 4.2.1 rasbean jelly rom

Custom kernel is gone after flashing a rom

Why is it that I have to reflash a custom kernel every time I flash the newest build of a rom?
Any time you flash a custom ROM, it will always include some kernel along with it. Hence, when you flash the newest build of a rom, you're also re-flashing the original kernel that it came with.
btse said:
Any time you flash a custom ROM, it will always include some kernel along with it. Hence, when you flash the newest build of a rom, you're also re-flashing the original kernel that it came with.
Click to expand...
Click to collapse
I see. Thanks! So I pretty much gotta flash my own custom kernel every time then?
As far as I know yes. There could possible be some way of flashing without the kernel, but I think it's much safer to just flash the whole custom ROM and then re-flashing your own custom kernel.
Yeah the easiest thing to do is just install the ROM with its kernel then just flash your kernel of choice.
Sent from my Nexus 4 using Tapatalk 2

First post on kernels

After reading the forum for a few few hours and finding some great info and reading more.
My noob question(please dont bite my head of for asking)
can you flash a kernal without installing a rom? Just got my N7 unlocked it, rooted no probs. and want to take things one thing at a time.
Thanks
ajg007 said:
After reading the forum for a few few hours and finding some great info and reading more.
My noob question(please dont bite my head of for asking)
can you flash a kernal without installing a rom? Just got my N7 unlocked it, rooted no probs. and want to take things one thing at a time.
Thanks
Click to expand...
Click to collapse
yes. you can flash a custom kernel without flashing a rom. pretty much all of the custom kernels can run on stock roms. youll need a custom recovery to flash it though(or flash franco kermel through fastboot).
Absolutely. Kernel is usually contained in a boot.img while ROMs by definition are modifications to a system.img. Most ROMs either use a modified stock boot image, a custom built boot image or the CyanogenMod boot image .
The boot.img usually contains a kernel and a ramdisk. This ramdisk tells the kernel how to interface with system.img which us why I said earlier "modified" since not all boot image use stock ramdisk and need to be modified.
As for you question. There are always ways to make a 3rd party kernel integrate with a ROM or repackage a internal boot image of a ROM to contain a stock kernel. My suggestion would be find a rom you like and then flash the old boot image. This will not work on all devices so i suggest looking it up in you developers section. If worst comes to worse i would recommend googling or searching the forums for unpacking and repacking boot.img and then trying your luck at that.
Please do this at your own risk. I am not to be held responsible for your actions.
Sent from my Galaxy Nexus using xda app-developers app
Loglud said:
Absolutely. Kernel is usually contained in a boot.img while ROMs by definition are modifications to a system.img. Most ROMs either use a modified stock boot image, a custom built boot image or the CyanogenMod boot image .
The boot.img usually contains a kernel and a ramdisk. This ramdisk tells the kernel how to interface with system.img which us why I said earlier "modified" since not all boot image use stock ramdisk and need to be modified.
As for you question. There are always ways to make a 3rd party kernel integrate with a ROM or repackage a internal boot image of a ROM to contain a stock kernel. My suggestion would be find a rom you like and then flash the old boot image. This will not work on all devices so i suggest looking it up in you developers section. If worst comes to worse i would recommend googling or searching the forums for unpacking and repacking boot.img and then trying your luck at that.
Please do this at your own risk. I am not to be held responsible for your actions.
Sent from my Galaxy Nexus using xda app-developers app
Click to expand...
Click to collapse
most custom kernels are using koushs' anykernel nowadays, so theres no ramdisk involved, besides the ramdisk that comes with the roms kernel. this way theres a better chance of compatibility. except for franco kernel and cm kernel, which use there own ramdisk. anykernel grabs the available ramdisk(the roms default kernels ramsisk).

[Q] Canadian MDJ firmware vs MDL ROM

I currently have a brand new Canadian S4 with the MDJ firmware/baseband version.
Most of the roms are MDL based.
Do i have to change the base firmware/baseband to MDL before flashing and MDL rom ?
My goad is to install CleanRom wich is MDL based.
Thanks for the guidance.
Xetalx
Xetalx said:
I currently have a brand new Canadian S4 with the MDJ firmware/baseband version.
Most of the roms are MDL based.
Do i have to change the base firmware/baseband to MDL before flashing and MDL rom ?
My goad is to install CleanRom wich is MDL based.
Thanks for the guidance.
Xetalx
Click to expand...
Click to collapse
You can just flash the ROM. Just make a Nandroid backup first. Some ROM's come with a custom kernel and you may need to flash a Canadian kernel directly after flashing the ROM.
blyndfyre said:
You can just flash the ROM. Just make a Nandroid backup first. Some ROM's come with a custom kernel and you may need to flash a Canadian kernel directly after flashing the ROM.
Click to expand...
Click to collapse
I did get the original Kernel file for my cell provider. It is a TAR file with boot.img into it.
What is the easyest way to apply it after flashing the Rom in TWRP ?
Thanks
Xetalx
TARs are flashed with Odin or Mobile Odin.
Xetalx said:
I did get the original Kernel file for my cell provider. It is a TAR file with boot.img into it.
What is the easyest way to apply it after flashing the Rom in TWRP ?
Thanks
Xetalx
Click to expand...
Click to collapse
If you are flashing the STOCK firmware for your specific carrier it will include the STOCK kernel.
If you are using a custom ROM like Mint Jelly or something, I'd say flash Adam kernel after flashing the ROM. You won't want to flash a STOCK kernel with a custom ROM.
Did you end up updating to MDL?
I also have the MDJ kernel and I installed CleanRom, I now cannot get wifi and TWRP will not boot in recovery mode. I thought it would be easier just to update to MDL to get wifi but mobile Odin did not work.
Thank you
travisobvs said:
Did you end up updating to MDL?
I also have the MDJ kernel and I installed CleanRom, I now cannot get wifi and TWRP will not boot in recovery mode. I thought it would be easier just to update to MDL to get wifi but mobile Odin did not work.
Thank you
Click to expand...
Click to collapse
Regarding wifi on CleanROM, did you check post #2 here?
bo8 said:
Regarding wifi on CleanROM, did you check post #2 here?
Click to expand...
Click to collapse
No I did not,
Truthfully I am a pretty big Noob to all of this and was afraid of changing my kernel to MF3 from MDJ. I really didn't know how that would affect my phone / carrier situation here in Canada. The main problem was that I could not get the phone into recovery mode. Turns out I just needed to re-root the phone. So when I got the phone to actually go into recovery I jumped at the CM Rom. When I find a forum that helps me understand what updating my Kernel does to my phone I will try to update Kernel and go back to CleanRom. I kind of miss multiwindow.... maybe a little bit of Touchwiz...
Thanks for the reply!
EDIT : I also found this : http://www.scottsroms.com/downloads.php?do=file&id=421 which is a version of CleanROM made for the MDJ but it is dated further back which threw me for a loop too.
travisobvs said:
No I did not,
Truthfully I am a pretty big Noob to all of this and was afraid of changing my kernel to MF3 from MDJ. I really didn't know how that would affect my phone / carrier situation here in Canada. The main problem was that I could not get the phone into recovery mode. Turns out I just needed to re-root the phone. So when I got the phone to actually go into recovery I jumped at the CM Rom. When I find a forum that helps me understand what updating my Kernel does to my phone I will try to update Kernel and go back to CleanRom. I kind of miss multiwindow.... maybe a little bit of Touchwiz...
Thanks for the reply!
EDIT : I also found this : http://www.scottsroms.com/downloads.php?do=file&id=421 which is a version of CleanROM made for the MDJ but it is dated further back which threw me for a loop too.
Click to expand...
Click to collapse
No worries and you're very welcome! Don't sweat, I'm still on stock ROM because I'm hesitant to make the ROM dive. Don't know how or if installing MF3 kernel via custom ROM would affect the phone in terms of rooting or custom recovery either. I'd probably be sticking with MDJ build if possible.
You and me both on multiwindow! Helps a ton when it comes to referencing something while emailing/texting! I'd miss the TW camera as well ... maybe. haha
Which version of TWRP are you on? Version 2.6 has an often-experienced issue where it just hangs at the "teamwin" splash screen. Downgrading to 2.5.0.2 resolves that.
Any updates?
bo8 said:
No worries and you're very welcome! Don't sweat, I'm still on stock ROM because I'm hesitant to make the ROM dive. Don't know how or if installing MF3 kernel via custom ROM would affect the phone in terms of rooting or custom recovery either. I'd probably be sticking with MDJ build if possible.
You and me both on multiwindow! Helps a ton when it comes to referencing something while emailing/texting! I'd miss the TW camera as well ... maybe. haha
Which version of TWRP are you on? Version 2.6 has an often-experienced issue where it just hangs at the "teamwin" splash screen. Downgrading to 2.5.0.2 resolves that.
Click to expand...
Click to collapse
Hey guys,
I am also a 1337m Rogers S4 (MDJ) owner, also a noob as well. I managed to flash my phone with CM and had a pretty good AOSP experience and learned a little bit on the way. I can legitimately say that I miss a couple thing about stock / Touch wiz, mainly the multiwindow support and camera. Cyanogenmod is also acting up and drains battery pretty bad when I am roaming in the states.
What did you guys end up doing? Did you update your base-band to mdk and install CleanRom? Right now that looks like it's my goal but I truthfully have no idea how to do it.
Did you guys go back to stock after changing? Do I just find a stock ROM on the forum and use ODIN to bring it back?
Is switching roms as easy as choosing something in Goo manager or do you need to go into a recovery in recovery mode?
Thank you!

Request for Cyanogenmod for Sprint Galaxu S7

If any developer has the time, please consider looking into making a cm rom, cause we've managed to get echoe rom working on the Sprint S7.
ItsYaminNoodlez said:
If any developer has the time, please consider looking into making a cm rom, cause we've managed to get echoe rom working on the Sprint S7.
Click to expand...
Click to collapse
Idk if it can be done on locked bootloaders that are tw launcher based because Cm is aosp based
vegoja said:
Idk if it can be done on locked bootloaders that are tw launcher based because Cm is aosp based
Click to expand...
Click to collapse
True didn't think of that. Hopefully we find a way to bypass that or unlock the bootloader.
The only thing that stops us from having a Cyanogen rom on our phones is our locked bootloaders. It doesn't matter that we have Twiz based OS on our phones cuz when you flash a rom from a custom recovery, it basically writes a whole new OS onto the phone. So whatever OS your running prior to the flash gets overwritten with the new OS.
So the only way we can flash a custom OS is if our bootloaders get unlocked, cuz once that happens we can flash a custom recovery, and from there we can flash whatever rom we want, as long as its made for our phones. First we got to have a working root method, then we have to have our bootloaders unlocked so we can flash a custom recovery, then we can flash away. We have a root method now, so it's only a matter of time until our bootloaders are unlocked. IMO
Sent from my SM-G930P using Tapatalk
sniperkill said:
The only thing that stops us from having a Cyanogen rom on our phones is our locked bootloaders. It doesn't matter that we have Twiz based OS on our phones cuz when you flash a rom from a custom recovery, it basically writes a whole new OS onto the phone. So whatever OS your running prior to the flash gets overwritten with the new OS.
So the only way we can flash a custom OS is if our bootloaders get unlocked, cuz once that happens we can flash a custom recovery, and from there we can flash whatever rom we want, as long as its made for our phones. First we got to have a working root method, then we have to have our bootloaders unlocked so we can flash a custom recovery, then we can flash away. We have a root method now, so it's only a matter of time until our bootloaders are unlocked. IMO
Click to expand...
Click to collapse
So wait, I've flashed a custom rom (echoe rom) on the galaxy s7 using flashfire and it works fine, so what would stop Cyanogenmod from working on the Galaxy s7?
ItsYaminNoodlez said:
So wait, I've flashed a custom rom (echoe rom) on the galaxy s7 using flashfire and it works fine, so what would stop Cyanogenmod from working on the Galaxy s7?
Click to expand...
Click to collapse
That rom is still touchwiz based. Kernel is the same, usually cm/aosp roms use a different kernel or greatly modified kernel.
Sent from my SM-G930P using XDA-Developers mobile app
lvpre said:
That rom is still touchwiz based. Kernel is the same, usually cm/aosp roms use a different kernel or greatly modified kernel.
Click to expand...
Click to collapse
Ah.

Categories

Resources