[DEVELOPERS TOOLS] Unpack, repack boot.img, and editing boot logo

Search This thread

mdfzhi

Senior Member
Jun 15, 2011
4,146
3,856
Good point to ask, can I do this with normal boot.img or I really need boot.img from nandroid backup??

any boot.img will do just fine, even stock boot.img grabbed from official stock rom. just need to edit the base parameter and pagesize specifically for the device in the script.
because this were posted in ace forum, the base parameter and pagesize already edited to works with ace kernel. u just need to reedit it back to match your device kernel.
 
  • Like
Reactions: ZduneX25

mdfzhi

Senior Member
Jun 15, 2011
4,146
3,856
i'm not sure about this one from ketut, because i'm comfortable using another one and it works the same.
http://xdaforums.com/showthread.php?t=1173427

in that one from peeter123, its in repack_bootimg.pl
Code:
--base 0x13600000 --pagesize 4096

edited: i've look into the script from ketut, while i'm not that good in scripting my guess is it'll grab that info automatically from dump it created when unpack.
in repackbootimg.sh
Code:
--base `cat unpack/$1-base`
 
Last edited:

FilipeMoritz

Senior Member
Jan 27, 2012
261
55
This tutorial is to be done in Linux, or I can make using the SDK?

Sent from my GT-S5830 using Tapatalk
 

ceriqdesign

Senior Member
Code:
BOARD_KERNEL_CMDLINE 
BOARD_KERNEL_BASE ffff8000
BOARD_PAGE_SIZE 00000000
*** glibc detected *** tools/unpackbootimg: free(): invalid next size (fast): 0x08749170 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6feb1)[0xb75f4eb1]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x71718)[0xb75f6718]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d)[0xb75f985d]
tools/unpackbootimg[0x80487fb]
tools/unpackbootimg[0x8048b84]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb759be46]
tools/unpackbootimg[0x8048641]
======= Memory map: ========
08048000-08049000 r-xp 00000000 08:01 2393176    /root/tools/unpackbootimg
08049000-0804a000 r--p 00001000 08:01 2393176    /root/tools/unpackbootimg
0804a000-0804b000 rw-p 00002000 08:01 2393176    /root/tools/unpackbootimg
08749000-0876a000 rw-p 00000000 00:00 0          [heap]
b7400000-b7421000 rw-p 00000000 00:00 0 
b7421000-b7500000 ---p 00000000 00:00 0 
b754e000-b756a000 r-xp 00000000 08:01 525234     /lib/i386-linux-gnu/libgcc_s.so.1
b756a000-b756b000 rw-p 0001b000 08:01 525234     /lib/i386-linux-gnu/libgcc_s.so.1
b7584000-b7585000 rw-p 00000000 00:00 0 
b7585000-b76e3000 r-xp 00000000 08:01 525150     /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
b76e3000-b76e5000 r--p 0015e000 08:01 525150     /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
b76e5000-b76e6000 rw-p 00160000 08:01 525150     /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
b76e6000-b76e9000 rw-p 00000000 00:00 0 
b7700000-b7704000 rw-p 00000000 00:00 0 
b7704000-b7706000 r--p 00000000 00:00 0          [vvar]
b7706000-b7708000 r-xp 00000000 00:00 0          [vdso]
b7708000-b7724000 r-xp 00000000 08:01 525186     /lib/i386-linux-gnu/ld-2.13.so
b7724000-b7725000 r--p 0001b000 08:01 525186     /lib/i386-linux-gnu/ld-2.13.so
b7725000-b7726000 rw-p 0001c000 08:01 525186     /lib/i386-linux-gnu/ld-2.13.so
bfcbc000-bfcdd000 rw-p 00000000 00:00 0          [stack]
Aborted

when i extract my boot.img this what happened..can anyone explain to me?
 

hyunno

Member
Sep 22, 2023
49
2
Samsung Galaxy Ace: Unpack and repack boot.img, editing boot logo
Ketut P. Kumajaya ketut.kumajaya @ xda-developers.com

Unpacking boot.img:
Code:
$ mkdir -p unpack
$ tools/unpackbootimg -i boot.img -o unpack

Extracting boot.img-ramdisk.gz
Code:
$ mkdir -p unpack/boot.img-ramdisk
$ cd unpack/boot.img-ramdisk
$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
$ cd ../../

Packing a new ramdisk:
Code:
$ tools/mkbootfs unpack/boot.img-ramdisk | gzip > unpack/boot.img-ramdisk.gz

Create a new boot.img:
Code:
$ tools/mkbootimg --kernel unpack/boot.img-zImage --ramdisk unpack/boot.img-ramdisk.gz -o boot.img-repack --base `cat unpack/boot.img-base`

Convert rle to png:
Code:
$ tools/from565 -rle < COOPER.rle > COOPER.raw
$ convert -size 320x480 -depth 8 rgb:COOPER.raw COOPER.png

Convert png to rle:
Code:
$ convert -depth 8 COOPER-new.png rgb:COOPER-new.raw
$ tools/to565 -rle < COOPER-new.raw > COOPER-new.rle

NOTE:
For developers only, don't ask me for support! Solve your problems by yourself!

PASSWORD:
As usual: ketut.kumajaya

Original boot.img size is 98304Kb.
After Unpack ans Repack, the boot.omg-repak size is 38210Kb...
Why is the size between Original boot.img and boot.omg-repak defferent?...
Also, the boot.omg-repak not boot...

1701090572737.png
 
Last edited by a moderator:

hyunno

Member
Sep 22, 2023
49
2
Wow, Successful with kitchen v3.8-Win32!!!
Now, the only question left is how to combine What part of LENOVO Android boot.img file and What part of Xiaomi Windows boot.img file...
Can anyone help me...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 57
    Samsung Galaxy Ace: Unpack and repack boot.img, editing boot logo
    Ketut P. Kumajaya ketut.kumajaya @ xda-developers.com

    Unpacking boot.img:
    Code:
    $ mkdir -p unpack
    $ tools/unpackbootimg -i boot.img -o unpack

    Extracting boot.img-ramdisk.gz
    Code:
    $ mkdir -p unpack/boot.img-ramdisk
    $ cd unpack/boot.img-ramdisk 
    $ gzip -dc ../boot.img-ramdisk.gz | cpio -i
    $ cd ../../

    Packing a new ramdisk:
    Code:
    $ tools/mkbootfs unpack/boot.img-ramdisk | gzip > unpack/boot.img-ramdisk.gz

    Create a new boot.img:
    Code:
    $ tools/mkbootimg --kernel unpack/boot.img-zImage --ramdisk unpack/boot.img-ramdisk.gz -o boot.img-repack --base `cat unpack/boot.img-base`

    Convert rle to png:
    Code:
    $ tools/from565 -rle < COOPER.rle > COOPER.raw
    $ convert -size 320x480 -depth 8 rgb:COOPER.raw COOPER.png

    Convert png to rle:
    Code:
    $ convert -depth 8 COOPER-new.png rgb:COOPER-new.raw
    $ tools/to565 -rle < COOPER-new.raw > COOPER-new.rle

    NOTE:
    For developers only, don't ask me for support! Solve your problems by yourself!

    PASSWORD:
    As usual: ketut.kumajaya
    4
    First post and attachment updated! Read README.txt and unpack/repack scripts for more details.
    2
    You should get "Recognized Developer" title, ketut.kumajaya! :D
    1
    ketut.kumajaya, is it possible to resize Data,System and Cache on Ace? Maybe something like this...?

    For example, the size of the partition of Indian (S5830DDKQ5) firmware are different (+1Mb to system and cache) from those that have been in all previous firmwares (KPN, KPH...).
    1
    Good point to ask, can I do this with normal boot.img or I really need boot.img from nandroid backup??

    any boot.img will do just fine, even stock boot.img grabbed from official stock rom. just need to edit the base parameter and pagesize specifically for the device in the script.
    because this were posted in ace forum, the base parameter and pagesize already edited to works with ace kernel. u just need to reedit it back to match your device kernel.