[Guide]How to mod a stock kernel (add adb root, init.d & bootanim support)
How to mod a stock kernel Tutorial (with Windows)
by: broodplank1337
In this tutorial I will explain how to unsecure a kernel and how to add init.d / custom bootanimation support to a stock kernel, in this tutorial we will be using Cygwin as shell, with Dsixda's Android Kitchen.
Chapters:
1. Getting the kernel
2. Setting up Cygwin
3. Setting up the Kitchen
4. Modifying the Kernel
5. Testing results
Chapter 1. Getting the Kernel
Since the kernel that you are going to use is a stock kernel, it can be found within the latest stock firmware. for example for the i9001, I have this Odin flashable: "I9001XXKQE_I9001ATOKP3_I9001XXKPL_HOME.tar.md 5". Open this file with Winrar and you will see the boot.img in there, just extract it and your currently done. It may also be a zImage!
Chapter 2. Setting up Cygwin
The Cygwin package you downloaded needs to be extracted, the default folder of a Cygwin installation is: "C:\cygwin". This is recommended in most cases. Once unpacked navigate to the "home" folder. In this home folder you need to create a folder that has the same username as your current windows username. Once you made that folder you have to extract the contents of "kitchen.rar" to that folder. So you will get a folder structure like this: C:\cygwin\home\username\kitchen
Chapter 3. Setting up Kitchen
Go to the original_update folder (located in: C:\cygwin\home\username\kitchen) and open dummyrom.zip with Winrar, now move your own boot.img inside the zip and choose "Store" as compression, Press ok to update the archive. If you have an zImage instead, please remove the boot.img from the archive first. Now browse to the system folder inside the archive and replace the build.prop with a build.prop from your phone. Also choose "Store" as compression and update the archive.
Starting the Kitchen:
1. Open Cygwin (X:\Cygwin\Cygwin.bat)
2. Once loaded, enter: "cd kitchen" > Enter
3. now type "sh menu" The kitchen menu will now start...
Setting up a working folder:
1. Press 1 > Enter
2. Press Enter and wait...
3. Choose (1) dummyrom.zip > Enter
4. Choose "y" > Enter > Enter a new name (I chose WORKING_KERNEL) > Enter
(now wait until the zip is extracted)
5. Choose 2 > Enter
6. Enter to return to main menu
Chapter 4. Modifying the Kernel
Unsecuring the kernel (to use properly with ADB)
1. Press 2 > Enter (to add root permissions)
2. Press "s" > Enter (now wait until the process is done)
3. Press Enter to return to main menu
Adding init.d support (for using startup scripts in /system/etc/init.d)
1. Press 0 > Enter
2. Press 17 > Enter (to add init.d support)
3. Enter "y" > Enter (now wait until the process is done)
4. Press Enter to return to main menu
Adding custom bootanimation support
Since the bootanimation support is already inside the dummyrom.zip file, you don't need to add it again.
Chapter 5. Testing the results
Now you will find a working boot.img / zImage under: C:\cygwin\home\username\kitchen\WORKING_KERNEL\
You can copy this file directly to your phone but it won't have bootanimation support.
That's why you need to enter in the Kitchen menu:
1. Press 99 > Enter
2. Press 1 > Enter
3. Press "n" > Enter
4. Press "y" > Enter
5. Press "y" > Enter > "EnterANewZipName" > Enter
6. Now your cwm zip will be located at: C:\cygwin\home\username\kitchen\OUTPUT_ZIP
The zip that can be found in the directory above can be flashable in CWM. Ejoy your own stock kernel with init.d/bootanimation support!
Samsung Galaxy S Plus (i9001)
Latest Roms:
broodROM Jellybean
- Powerful, smooth, stable, personalized, awesome battery life (1% per hour) and open source
-- Github here
Third post reserved for further use.
Just joking.You should make a tutorial to teach.us how to make an overclocked kernel and so on.
Btw nice tutorial from a great dev.
Great tutorial! Btw, this works also with cm9 kernels?
Sent from my GT-I9001 using xda premium
Thank you
And honestly I have no idea if it's working on CM9 kernels, I think it does work actually, you should give it a try
Quote:
Originally Posted by Costinutz32
Third post reserved for further use.
Just joking.You should make a tutorial to teach.us how to make an overclocked kernel and so on.
Btw nice tutorial from a great dev.
lol hehe, I wish I knew how to do that, If I knew that I would have posted a tutorial for sure :P. I'm totally inexperienced with coding kernels unfortunately :P
and thanks btw ^^
edit: added screenshots
Samsung Galaxy S Plus (i9001)
Latest Roms:
broodROM Jellybean
- Powerful, smooth, stable, personalized, awesome battery life (1% per hour) and open source
-- Github here
this is more a tutorial for how to make a rom flashable for cwm with kitchen
bootanimation with kitchen is not working for me, had to modify the init.rc manually in boot.img. but you can use the kitchen for extract the boot.img.
however, the headline of this thread is a bit confusing, the tutorial is ok.
i guess, it is not complete.
for set up working folder, you will need
system.ext4.tar
cache.ext4.tar
boot.img
from a nandroid backup of your rom
this is more a tutorial for how to make a rom flashable for cwm with kitchen
bootanimation with kitchen is not working for me, had to modify the init.rc manually in boot.img. but you can use the kitchen for extract the boot.img.
however, the headline of this thread is a bit confusing, the tutorial is ok.
i guess, it is not complete.
for set up working folder, you will need
system.ext4.tar
cache.ext4.tar
boot.img
from a nandroid backup of your rom
Well actually, I've kept the dummyrom.zip so minimalistic that boot.img is fully compatible with the kitchen (it needed app/bin folder and build.prop), but all other things are basically removed.
And you don't need all those files, we are not trying to create a working rom here, and the bootanimation is idd not working correctly, that's why I added the AOSP bootanimation library to the dummyrom.zip
Samsung Galaxy S Plus (i9001)
Latest Roms:
broodROM Jellybean
- Powerful, smooth, stable, personalized, awesome battery life (1% per hour) and open source
-- Github here
Well actually, I've kept the dummyrom.zip so minimalistic that boot.img is fully compatible with the kitchen (it needed app/bin folder and build.prop), but all other things are basically removed.
And you don't need all those files, we are not trying to create a working rom here, and the bootanimation is idd not working correctly, that's why I added the AOSP bootanimation library to the dummyrom.zip
ah, ok i didn't know about the dummyrom.zip
but only for extract boot.img and make the small changesfor init.d and bootanimation, you can use other methods, not the kitchen.
the setup for kitchen is much more work as needed for this.
you can also use the tool "disk internals linux reader" and change everything you want manually.
just my 2 cents.
maybe with alle that what you have done for this tutorial, you can change/expand it to "how to make a rom with kitchen"...
ah, ok i didn't know about the dummyrom.zip
but only for extract boot.img and make the small changesfor init.d and bootanimation, you can use other methods, not the kitchen.
the setup for kitchen is much more work as needed for this.
you can also use the tool "disk internals linux reader" and change everything you want manually.
just my 2 cents.
maybe with alle that what you have done for this tutorial, you can change/expand it to "how to make a rom with kitchen"...
well whatever. do it as you want. good luck.
about that, you're right, it can be done allot easier, but the thing is, I never got any working kernel when I manually packed them (or with some scripts), so I'm very thankful to the kitchen, which allows me to make an actual working boot.img
Samsung Galaxy S Plus (i9001)
Latest Roms:
broodROM Jellybean
- Powerful, smooth, stable, personalized, awesome battery life (1% per hour) and open source
-- Github here
New Mobile Operating System Jolla Sailfish‘s … more
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?