How to unpack, edit and repack boot.img

Search This thread

nikki2325

Senior Member
Oct 9, 2009
184
57
Hyderabad
*** I TAKE NO CREDIT. I JUST MADE A GUIDE TO HELP YOU***

A STEP BY STEP TUTORIAL :

I find many people struggling with unpacking a boot image and expecially repacking it. So here is a simple guide to unpack and repack the boot image.

>You need some tools so make sure you download all these.
List : (links available at bottom of page

split_bootimg.pl
repack_bootimg.pl
dsixda kitchen (you need some files from here)
Not to mention, a linux based system

> First you need to make some correction to repack_bootimg file(if downloaded from other source) . open it using gedit or some editor.

> check third line from bottom which is starting with system...If it is ending with $ARGV[2] then make this change

Add --base 0x19200000 and then close with " .

This now should look like

$ARGV[2] --base 0x19200000");

> Save it and exit. Now place boot.img and the two files in a folder(create new one. Don't mess it up)

> Now go to dsixda kitchen folder >tools >mkboot and copy all the files to your working directory

> Now you have mkbootfs.c and mkbootimg.c files along with needed header files. You have to make them executable. For that, run this command

gcc -o mkbootfs mkbootfs.c

change the permissions

chmod a+x ....(path)/mkbootfs

Now do the same for mkbootimg.c

gcc -o mkbootimg mkbootimg.c

change the permissions

chmod a+x ....(path)/mkbootimg

Now you are ready to go. Just navigate to directory in command prompt and type

./split_bootimg.pl boot.img
(or)
perl split_bootimg.pl boot.img

you will get some files. one is kernel and other is ramdisk. extract ramdisk.gz. Now again extract ramdisk(cpio file) . Make necessary changes.

To repack, use this command

perl repack-bootimg.pl <kernel_name> ramdisk_directory_name boot.img

( you need mkbootimg for this to work)

Bingo you have a boot.img which is ready to test.


LINKS :

Split_bootimg.pl : http://www.mediafire.com/?i4omee9loaxawtk

Repack_bootimg.pl : http://www.mediafire.com/?sthhkkkkctdvb3d

dsixda kitchen : http://xdaforums.com/showthread.php?t=633246
 

nikki2325

Senior Member
Oct 9, 2009
184
57
Hyderabad
IS YOUR dsixda kitchen FIX FOR MOTO ?

If you are talking about using the kitchen for motorola, it supports only few devices.

Motorola Atrix (unconfirmed)
Motorola CLIQ / CLIQ XT
Motorola Droid (unconfirmed)
Motorola Milestone (unconfirmed) - you may need to remove the boot.img before building

here is moto list...If you are talking about repacking n stuff, it supports any vendor.
 

godson32

Senior Member
May 25, 2009
150
3
godson32
can sum1 plz help me.... i have evo root 2.2 i was trying to nandriod backup in restore . once i got done doing both i rebooted sys. all i get is the while htc evo screen oh ima noob, plz sum one help, oh im running clockworkmod recovery v2.6.0.1
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    *** I TAKE NO CREDIT. I JUST MADE A GUIDE TO HELP YOU***

    A STEP BY STEP TUTORIAL :

    I find many people struggling with unpacking a boot image and expecially repacking it. So here is a simple guide to unpack and repack the boot image.

    >You need some tools so make sure you download all these.
    List : (links available at bottom of page

    split_bootimg.pl
    repack_bootimg.pl
    dsixda kitchen (you need some files from here)
    Not to mention, a linux based system

    > First you need to make some correction to repack_bootimg file(if downloaded from other source) . open it using gedit or some editor.

    > check third line from bottom which is starting with system...If it is ending with $ARGV[2] then make this change

    Add --base 0x19200000 and then close with " .

    This now should look like

    $ARGV[2] --base 0x19200000");

    > Save it and exit. Now place boot.img and the two files in a folder(create new one. Don't mess it up)

    > Now go to dsixda kitchen folder >tools >mkboot and copy all the files to your working directory

    > Now you have mkbootfs.c and mkbootimg.c files along with needed header files. You have to make them executable. For that, run this command

    gcc -o mkbootfs mkbootfs.c

    change the permissions

    chmod a+x ....(path)/mkbootfs

    Now do the same for mkbootimg.c

    gcc -o mkbootimg mkbootimg.c

    change the permissions

    chmod a+x ....(path)/mkbootimg

    Now you are ready to go. Just navigate to directory in command prompt and type

    ./split_bootimg.pl boot.img
    (or)
    perl split_bootimg.pl boot.img

    you will get some files. one is kernel and other is ramdisk. extract ramdisk.gz. Now again extract ramdisk(cpio file) . Make necessary changes.

    To repack, use this command

    perl repack-bootimg.pl <kernel_name> ramdisk_directory_name boot.img

    ( you need mkbootimg for this to work)

    Bingo you have a boot.img which is ready to test.


    LINKS :

    Split_bootimg.pl : http://www.mediafire.com/?i4omee9loaxawtk

    Repack_bootimg.pl : http://www.mediafire.com/?sthhkkkkctdvb3d

    dsixda kitchen : http://xdaforums.com/showthread.php?t=633246