[Samsung Galaxy SL i9003] sachin sharma:
U all must be thinking that there are a hell lot of guides for this than what this guide is here for?

And the answer is that i have used almost all guides to extract our kernel for latest builds like cm7,cm9 etc but after using the guides present here on xda , after the last step i didn't get any directories instead got two files name ramdisk.gz and recovery.cpio now this guide will tell what to do next!!!

First of all download the perl scripts from

HERE

Now after download do this:

1. Create two directories and sub directories:

$ mkdir -p old-boot/ramdisk

$ mkdir new-boot

2. Copy the zImage file which ye have made to the "new-boot"

3. Put your old directory boot.img to the "old-boot"

4. Extract the directory bootimgutils.zip to "old-boot"

5. Split boot.img with the command:

$ cd old-boot

$ ./boot.img split_bootimg.pl

or

$ perl split_bootimg.pl boot.img

there will be an appearance of more or less like this (depending on the type of your device):

Page size: 2048 (0x00000800)

Kernel size: 1388548 (0x00153004)

Ramdisk size: 141 518 (0x000228ce)

Second size: 0 (0x00000000)

Board name:

Command line: no_console_suspend = 1

Writing boot.img-kernel ... complete.

Writing boot.img-ramdisk.gz ... complete.

of the split will produce two files, namely boot.img-kernel and boot.img-ramdisk.gz

boot.img-kernel = kernel/zImage

boot.img-ramdisk = ramdisk

6. Now to edit the ramdisk then unpack the boot-img-ramdisk.gz with the following command :

$ cd ramdisk

$ gzip -dc ../boot.img-ramdisk.gz | cpio -i

after that u will have two files "ramdisk.gz" and "recovery.cpio"

7. Now go to ubuntu software center n download a application know as Ark

8. now right click on ramdisk.gz choose open with ark after that extract all the files

9.Now u will have all those directories n files u want!!!!

10. After editing repacking them by drag n drop method i.e. open ramdisk.gz file again using ark than select all those files u just extracted drag them and drop them on ramdisk.gz (opend in ark)

11.Now do the same with recovery.cpio if u want to edit something from it else skip

12 Now u have to repack all that stuff for that do

first repack ramdisk for that use

"find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz"

After that u have to repack boot.img for that use this

(if u have editing ramdisk)

$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/newramdisk.cpio.gz --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img

(if u have not edited ramdisk that use)

$ ./mkbootimg --kernel /home/your user_id/new-boot/zImage --ramdisk /home/your user-id/old-boot/boot.img-ramdisk --base 0x80000000 --pagesize 2048 -o /home/user-id/new-boot/boot.img

Note: if u have made ur own zimage than place it in the "New-boot" folder n delete all other files

if u want repack the old zimage than rename the ur extracted "boot.img-kernel" to "zimage" n place in "New-boot" folder

Remeber u will have ur new boot.img in "New boot folder"

========================================================

Now for those who can't Download ark using Software center

1. download ark from this site

2. upack the ramdisk.gz/recovery.cpio using this command

ark --extract /home/your user-id/old-boot/ramdisk/ramdisk.gz

3. repack using

ark --add /home/your user-id/old-boot/ramdisk

it will promp the name of archive to add files to

choose the ramdisk.gz file!!!

The End

"HAVE A HAPPY KERNELING"