[KITCHEN]Android Kernel Kitchen 0.3.1 (Linux / Windows)

Search This thread

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
INTRODUCTION
So we all know dsixda's XDA ROM Kitchen
Then how about a kitchen for Kernels ??

What started out just as my personal directory where I kept all my kernel and ramdisk tinkering scripts, has now turned into a project (which is far from finished right now :p )

This does NOT enable you to compile the kernel binary (aka zImage).
This enables you to edit ramdisk and change bootsplash images and helps kernel developers to deploy their compiled kernel in a usable form.

FEATURES
As of now what we can do with the Kernel Kitchen is

  1. Fully menu driven interface (like dsixda kitchen)
  2. Extract zImage and ramdisk from boot.img file
  3. Create boot.img from zImage and ramdisk
  4. Extract zImage and ramdisk from any ftf file that contains kernel.sin (Xperia 2010, 2011, 2012)
  5. Create flashable ftf from zImage and ramdisk (Xperia 2010 only)
  6. Create kernel.sin from zImage and Ramdisk and also split kernel.sin into zimage and ramdisk
  7. Extract zImage, ramdisk and its contents from kernel.elf (Xperia 2012)
  8. Create kernel.elf from ramdisk, zImage (and RPM) - for Xperia 2012
  9. Create compressed ramdisk binary from ramdisk folder
  10. Extract ramdisk files from ramdisk binary
  11. Convert png image to rle format (used in android boot splash images)
  12. Convert rle boot splash to png file (so that you can edit it)
Proposed upcoming features

  1. Automatic script to change boot splash in a kernel with your favourite png file
STYLE CODE :
bold are supported only in linux
italics are supported in linux and windows+cygwin
underline are supported in windows native (without cygwin)
(if more than one style is used, it supports all respective platforms)

WARNING !!!!

[SIZE=+1]Please be well informed that whenever you distribute/redistribute a kernel zImage or the whole boot.img that contains the zImage or the kernel in any form in which it contains the compiled zImage, you MUST provide the option to view it's sources or else it'll be a major violation of GPL (General Public License) which governs the Linux kernel.

If you are using a compiled kernel made available by some other dev, then you are SUPPOSED TO mention it clearly and provide a link back to the original location from where you got the kernel (original thread) and also the sources of that kernel

If anyone uses this tool to unpack/repack a kernel and redistribute it publicly on xda (or any other website) then it's his responsibility to maintain proper credits and acknowledgement of works of original developers and also it's his/her responsibility to comply with the GPL[/SIZE]


A NOTE OF ADVICE

[SIZE=+1]I would like to mention here that this kitchen was made with two purposes in mind.

1. For someone who already knows how to do all this complicated ****, but wants a tool of convenience to do it automatically

2. For people who do not know much about custom kernels but want to make minor changes to ramdisk (making it insecure, or changing the bootlogo) for their PERSONAL use.

This tool is NOT meant to be used to repackage works of other developers and pass them on as your work.
In any case, if you want to redistribute a kernel created using my tool, then I suggest you to read the WARNING above once again all over, and also properly read the GPL v2 (link here) and specifically section 3 of GPL

[/SIZE]
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.


REQUIREMENTS
This tool is primarily meant for linux users (preferably Uubuntu).
But it works perfectly well on windows+cygwin too :)

Some portions of the kitchen have support for native windows (without even cygwin)

Rest all requirements are mentioned in the readme :)

WHAT ARE ITS USES ?

1.
The primary purpose (for which this project started out in the first place) is to provide a easy kernel deployment tool for wannabe kernel devs.
A lot of us can compile a kernel from source but that is just the zImage and cannot be used as such on the phone. We need to package it with a ramdisk ad deploy it thorough a proper method (flashtool for Xperia, ODIN for samsund, and fastboot for other phones)

2.
You canedit ramdisk properties (by editing default.prop)
Changing ro.secure=1 to ro.secure=0 makes your ramdisk insecure and enables easy root access :)
3.
The most immediate and popular use that i can see right now is changing the boot logo to your liking
the boot logo is called logo.rle or initlogo.rle and is placed in the root of ramdisk folder.
When you split kernel, you can find the rle file which you can convert into png, do necessary editing and convert back into rle and pack up the ramdisk and create a new kernel

4.
Other than that, you can change the recovery system
for eg. you can include Doom's Touch recovery system inside your favourite kernel
or you can include the xRecovery inside CM7 kernel so that you can flash amend zips.
Changing the recovery is ofcourse a little more complicated for average users, and i'll write a short tuto for that soon enough :)
DOWNLOAD AND USAGE
The sources can be found on www.github.com/championswimmer/kernel-tools


For linux (and cygwin) users I recommend the install git and run this command to get a copy of my repository
Code:
 git clone  https://github.com/championswimmer/kernel-tools.git
Or in general, all linux and windows users can just get a zipball of my repo here
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
All usage information can be found on this elaborate readme

In short all you have to do is cd to the appropriate folder and run this

Code:
./menu
or you can just double-click menu and click "run in terminal"

CREDITS
None of this was possible without the helps and works of DoomLord, Azuzu, bin4ry, FXP, defer, blagus, nobodyAtall, the_laser, Androxyde


These works are directly included in my project
DoomLord's kernel.sin and ftf creator (windows version)


These works are used in their modified/repackaged form
DoomLord's png and rle interconversion tool (windows version)
DoomLord's perl script to split kerel.sin

And big thanks to nobodyAtall for pointing me the appropriate linux binaries (or i would have kept pouring wine over windows exe files)

Huge thanks to Atarii and this thread of his for all info needed to manipulate kernel.elf files on Xperia 2012 line

Thanks to ImageMagick developers for the awesome tool

SOURCES USED
1. to565 and from565 source code (part of Android Open Source Project)

2. mkbootimg and mkbootfs standalone sources (part of AOSP)

3. abootimg sources (by Gilles Grandou)
 
Last edited:

Toledo_JAB

Retired Forum Moderator
Jan 16, 2011
3,076
3,142
Toledo
nice work going on here champ. downloading kCernel-thgo from github now. i cant wait to try your kernel tools. thanks for your work. :-D
 
  • Like
Reactions: Master MB2

wo88les

Senior Member
Nov 6, 2010
953
392
nice work going on here champ. downloading kCernel-thgo from github now. i cant wait to try your kernel tools. thanks for your work. :-D

:( doesnt work on windows :( cant unpack lol

iv read through readme's and it keeps saying the same thing,

i have also tried extracting FTF, i got a Kernel.sin and a loader.sin bit still no idea how to extract out of those.. any ideas lol
 

Toledo_JAB

Retired Forum Moderator
Jan 16, 2011
3,076
3,142
Toledo
Dual boot Linux for 'Kernel Kitchen'

wo88les said:
doesnt work on windows cant unpack lol

iv read through readme's and it keeps saying the same thing,

i have also tried extracting FTF, i got a Kernel.sin and a loader.sin bit still no idea how to extract out of those.. any ideas lol
REQUIREMENTS
This tool is primarily meant for linux users (preferably Uubuntu).
But it works perfectly well on windows+cygwin too

I have installed UBUNTU on a separate linux partition from windows xp ntfs partition. after ubuntu install i have dual boot UBUNTU/XP.

If anyone would like help SETTING-UP a dual boot machine to use Champ's 'kernel kitchen' please PM (private message) me and i will help. Please use PM to help Champ keep his thread SPAM free :-D
 

wo88les

Senior Member
Nov 6, 2010
953
392
Today I had a little look at ubuntu and your guide and was able to view the various settings. I didn't change anything as I'm totally stumped where to start hehe but I'll continue through your guide again when I'm home.

Again. Great work champ :) and thank you

Sent from my X10S v8.2 using XDA Premium
 

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
That sounds really neat. Thats really impressive. So, is it possible to tinker with the kernel.sin file in an update package and get a working ftf file from it, kernel cooker? Hmm? And if so, how? :p

thats easy

take a kernel.ftf file which was meant for unlocked bootloader.

open it wit zip/rar/7zip/bzip software (yes ftf = zip )

replace the kernel.sin inside it with the one you have.

while flashing, the version might not show correct but once flashed, you'll find your kernel running fine :)

Sent from my X10S using xda premium
 

TAL333

Senior Member
Jun 15, 2011
493
262
Los Angeles
thats easy

take a kernel.ftf file which was meant for unlocked bootloader.

open it wit zip/rar/7zip/bzip software (yes ftf = zip )

replace the kernel.sin inside it with the one you have.

while flashing, the version might not show correct but once flashed, you'll find your kernel running fine :)

Sent from my X10S using xda premium

I got impatient waiting so I tried a bundle creation through Flashtool. Since my phone isn't bricked I figure that works too. And quicker too.;) :p Not to stray off topic but since I will probably be using CM9 soon I think its time you posted an easy way to enable on screen buttons in CM9 for newbs like me on your ultimate repository of Champy goodness. :p Please. And make it dumbproof. Please......


tal333 :cool:
 

wo88les

Senior Member
Nov 6, 2010
953
392
I just remembered about your kitchen sorry champ, do you think this will fix my WiFi compiling? Cheers :) so far I have 25hrs of battery with my kernel but it's not really an honest result considering there is no WiFi at all

Sent from my X10S v8.2 using XDA Premium
 

TeamMex

Recognized Developer / Inactive RC
I have this problem S



Press [Enter] key to create ftf...

Please mention for which device you are packing kernel
For X10, enter 1
For X8, Mini or MiniPro enter 2
Type either 1 or 2 and press enter
2
read 00489B43 bytes
...................................... cp: can not stat `on 'loader_unlocked_7x27 . no ': No such file or directory
----------------ENTER KERNEL BRANDING DETAILS------------
 

manoranjan2050

Senior Member
Dec 26, 2011
1,087
1,417
JAGATSINGHPUR
manoranjan2050.org
Thanks ................

Wow Friend Very nice work......................


its really need for all android DEV


finally i build my own kernel using ezy/great tools

test this tool soon .........


BTW : its ezy for new user or not ??????
 

Top Liked Posts

  • There are no posts matching your filters.
  • 180
    INTRODUCTION
    So we all know dsixda's XDA ROM Kitchen
    Then how about a kitchen for Kernels ??

    What started out just as my personal directory where I kept all my kernel and ramdisk tinkering scripts, has now turned into a project (which is far from finished right now :p )

    This does NOT enable you to compile the kernel binary (aka zImage).
    This enables you to edit ramdisk and change bootsplash images and helps kernel developers to deploy their compiled kernel in a usable form.

    FEATURES
    As of now what we can do with the Kernel Kitchen is

    1. Fully menu driven interface (like dsixda kitchen)
    2. Extract zImage and ramdisk from boot.img file
    3. Create boot.img from zImage and ramdisk
    4. Extract zImage and ramdisk from any ftf file that contains kernel.sin (Xperia 2010, 2011, 2012)
    5. Create flashable ftf from zImage and ramdisk (Xperia 2010 only)
    6. Create kernel.sin from zImage and Ramdisk and also split kernel.sin into zimage and ramdisk
    7. Extract zImage, ramdisk and its contents from kernel.elf (Xperia 2012)
    8. Create kernel.elf from ramdisk, zImage (and RPM) - for Xperia 2012
    9. Create compressed ramdisk binary from ramdisk folder
    10. Extract ramdisk files from ramdisk binary
    11. Convert png image to rle format (used in android boot splash images)
    12. Convert rle boot splash to png file (so that you can edit it)
    Proposed upcoming features

    1. Automatic script to change boot splash in a kernel with your favourite png file
    STYLE CODE :
    bold are supported only in linux
    italics are supported in linux and windows+cygwin
    underline are supported in windows native (without cygwin)
    (if more than one style is used, it supports all respective platforms)

    WARNING !!!!

    [SIZE=+1]Please be well informed that whenever you distribute/redistribute a kernel zImage or the whole boot.img that contains the zImage or the kernel in any form in which it contains the compiled zImage, you MUST provide the option to view it's sources or else it'll be a major violation of GPL (General Public License) which governs the Linux kernel.

    If you are using a compiled kernel made available by some other dev, then you are SUPPOSED TO mention it clearly and provide a link back to the original location from where you got the kernel (original thread) and also the sources of that kernel

    If anyone uses this tool to unpack/repack a kernel and redistribute it publicly on xda (or any other website) then it's his responsibility to maintain proper credits and acknowledgement of works of original developers and also it's his/her responsibility to comply with the GPL[/SIZE]


    A NOTE OF ADVICE

    [SIZE=+1]I would like to mention here that this kitchen was made with two purposes in mind.

    1. For someone who already knows how to do all this complicated ****, but wants a tool of convenience to do it automatically

    2. For people who do not know much about custom kernels but want to make minor changes to ramdisk (making it insecure, or changing the bootlogo) for their PERSONAL use.

    This tool is NOT meant to be used to repackage works of other developers and pass them on as your work.
    In any case, if you want to redistribute a kernel created using my tool, then I suggest you to read the WARNING above once again all over, and also properly read the GPL v2 (link here) and specifically section 3 of GPL

    [/SIZE]
    3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
    b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
    c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
    If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.


    REQUIREMENTS
    This tool is primarily meant for linux users (preferably Uubuntu).
    But it works perfectly well on windows+cygwin too :)

    Some portions of the kitchen have support for native windows (without even cygwin)

    Rest all requirements are mentioned in the readme :)

    WHAT ARE ITS USES ?

    1.
    The primary purpose (for which this project started out in the first place) is to provide a easy kernel deployment tool for wannabe kernel devs.
    A lot of us can compile a kernel from source but that is just the zImage and cannot be used as such on the phone. We need to package it with a ramdisk ad deploy it thorough a proper method (flashtool for Xperia, ODIN for samsund, and fastboot for other phones)

    2.
    You canedit ramdisk properties (by editing default.prop)
    Changing ro.secure=1 to ro.secure=0 makes your ramdisk insecure and enables easy root access :)
    3.
    The most immediate and popular use that i can see right now is changing the boot logo to your liking
    the boot logo is called logo.rle or initlogo.rle and is placed in the root of ramdisk folder.
    When you split kernel, you can find the rle file which you can convert into png, do necessary editing and convert back into rle and pack up the ramdisk and create a new kernel

    4.
    Other than that, you can change the recovery system
    for eg. you can include Doom's Touch recovery system inside your favourite kernel
    or you can include the xRecovery inside CM7 kernel so that you can flash amend zips.
    Changing the recovery is ofcourse a little more complicated for average users, and i'll write a short tuto for that soon enough :)
    DOWNLOAD AND USAGE
    The sources can be found on www.github.com/championswimmer/kernel-tools


    For linux (and cygwin) users I recommend the install git and run this command to get a copy of my repository
    Code:
     git clone  https://github.com/championswimmer/kernel-tools.git
    Or in general, all linux and windows users can just get a zipball of my repo here
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    All usage information can be found on this elaborate readme

    In short all you have to do is cd to the appropriate folder and run this

    Code:
    ./menu
    or you can just double-click menu and click "run in terminal"

    CREDITS
    None of this was possible without the helps and works of DoomLord, Azuzu, bin4ry, FXP, defer, blagus, nobodyAtall, the_laser, Androxyde


    These works are directly included in my project
    DoomLord's kernel.sin and ftf creator (windows version)


    These works are used in their modified/repackaged form
    DoomLord's png and rle interconversion tool (windows version)
    DoomLord's perl script to split kerel.sin

    And big thanks to nobodyAtall for pointing me the appropriate linux binaries (or i would have kept pouring wine over windows exe files)

    Huge thanks to Atarii and this thread of his for all info needed to manipulate kernel.elf files on Xperia 2012 line

    Thanks to ImageMagick developers for the awesome tool

    SOURCES USED
    1. to565 and from565 source code (part of Android Open Source Project)

    2. mkbootimg and mkbootfs standalone sources (part of AOSP)

    3. abootimg sources (by Gilles Grandou)
    16
    Some of the posts in this thread are complete PIGS ARSE.

    I don't have time for a full reply at the moment, but I've been around XDA long enough to know that kitchens are helpful and do promote learning and development.

    Back in the WM days of XDA, only a handful of devs (Tofclock, Helmi, Buzz etc...) were capable of building ROMs rom scratch using hex editors, playing with XIP files and dlls.

    WM5/6 Kitchens were being used when some of you were still at school smoking behind the bike sheds. Without them, XDA would almost certainly have never been as popular in the WM days, and the number of "great" ROMs would have been far less.

    When the first kitchen was released to us, this started a whole new wave of ROM creation. Sure, it made thigns easier, but a lot of people learned a LOT about WM development at the same time. I know I did.

    They're a learning tool if used in that manner. Fair enough they can be abused by some who "cook" something and call themselves a dev, but there are others who will use it and learn from it. I know I learned a LOT about WM drivers, registry etc, by using a kitchen.

    I don't give a flying f*ck if some of you can code a complete kernel in notepad. The size of your e-peen means nothing to me.

    XDA is about learning as much as anything, and if a kitchen helps people learn SOMETHING about kernels then I think that has to be a good thing.
    12
    Some of the posts in this thread are complete PIGS ARSE.

    I don't have time for a full reply at the moment, but I've been around XDA long enough to know that kitchens are helpful and do promote learning and development.

    Back in the WM days of XDA, only a handful of devs (Tofclock, Helmi, Buzz etc...) were capable of building ROMs rom scratch using hex editors, playing with XIP files and dlls.

    WM5/6 Kitchens were being used when some of you were still at school smoking behind the bike sheds. Without them, XDA would almost certainly have never been as popular in the WM days, and the number of "great" ROMs would have been far less.

    When the first kitchen was released to us, this started a whole new wave of ROM creation. Sure, it made thigns easier, but a lot of people learned a LOT about WM development at the same time. I know I did.

    They're a learning tool if used in that manner. Fair enough they can be abused by some who "cook" something and call themselves a dev, but there are others who will use it and learn from it. I know I learned a LOT about WM drivers, registry etc, by using a kitchen.

    I don't give a flying f*ck if some of you can code a complete kernel in notepad. The size of your e-peen means nothing to me.

    XDA is about learning as much as anything, and if a kitchen helps people learn SOMETHING about kernels then I think that has to be a good thing.

    I have to agree. While we will never be rid of the winzip rom makers tools like this help give people a place to start and to decide if they want to dig deeper into it. How can I say this you ask, it is because I am one of them. When I first started on XDA I knew next to nothing about development but with some of the great kitchens that were available I started to learn. Then When I needed to make deeper changes I had to dig in more and learn.

    Now on Android. I started out learning by unzipping roms and looking inside, Then came apktool and learning to theme to fix issues that others made in themes, then I moved up to a kitchen. Now I have taken the dive and to working on Source code. Which includes making my PC dual boot a Linux distro (which alo of people are not able.willing to do). None of which would have happened had I not started with tools just like this one.

    Now I see people going off at the mouth at each other. Some of you seem to think you are a coding wiz. Well let me tell you what. Your attitude is just the kind that we dont need. Personally I dont care what your title says. Get over yourselves and get back to what XDA is all about. Sharing and learning. If your not part of the solution then you are part of the problem. I would rather the tool be used by 100 people if it even helps 1 on the path to learning even more.
    8
    What I see when I see threads like this:

    Someone tries to make a helpful tool to generate interest in kernel development.

    A bunch of higher ups railroad them until they go away.

    No one learns anything and no one gets interested in kernel development.

    How come the people who say this isn't real development never reach out and try to teach people or generate interest? Frankly, if putting out a kitchen gets even one aspiring dev (aspiring dev is NOT a real dev, but one who is aspiring to be a real dev) interested enough to learn the "right way"...then the tool served it's purpose. If it's such a sin to post tools like this to get people interested in development, then why not write up some tutorials and show them how it's done? It's like saying "You can't shoot that gun, your worthless for even trying and you're what's wrong with the world because you can't shoot that gun"...and then give them zero pointers on learning how to shoot the gun.

    Part of the solution? Nah, that's being part of the problem. How are people supposed to get interested in real development when they know they'll be sharing a title with people who do nothing but tell other people they're doing it wrong? Additionally, how are they supposed to learn how to do it right when the people who know how to do it not only don't help, but squash every attempt of someone else to help?

    smh
    7
    for windows needs cygwin buddy

    and you need perl, python, cpio, gzip (or gunzip) installed inside cygwin :)