[Guide]How to mod a stock kernel (add adb root, init.d & bootanim support)
How to mod a stock kernel Tutorial (with Windows)
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.
- Cygwin with Packages and Dsixda's Android Kitchen
- A stock Kernel
- Some common sense
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)
Setting up a working folder:
2. Once loaded, enter: "cd kitchen" > Enter
3. now type "sh menu" The kitchen menu will now start...
1. Press 1 > Enter
Chapter 4. Modifying the Kernel
Unsecuring the kernel (to use properly with ADB)
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
1. Press 2 > Enter (to add root permissions)
Adding init.d support (for using startup scripts in /system/etc/init.d)
2. Press "s" > Enter (now wait until the process is done)
3. Press Enter to return to main menu
1. Press 0 > EnterAdding custom bootanimation support
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
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!
Device: Samsung Galaxy S4 (i9505) - Samsung Galaxy S Plus (i9001)
AOSP v4.4.2 (KOT49H) from source for I9505
- Cleanest ROM available for i9505. along with 3.4.73 kernel. Perfect base for rom developers.
-- Github here
Up-to-Date Bare Repositories for TW/AOSP 4.2.2/4.3 Kernels
- Want to build a i9505 kernel? Start here to make sure your kernel will fully compile and work.
-- Github here
broodKernel Google Edition
- Kernel for AOSP 4.2.2 Google Edition (Latest Linux kernel version)
-- Github here
For sources you can visit my Github
. Or take a look at all my projects