[DEVELOPERS TOOLS] Unpack, repack boot.img, and editing boot logo - Galaxy Ace S5830 Android Development

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

Too usefull
Thanks.

You should get "Recognized Developer" title, ketut.kumajaya!

If I have a Motorola Android device, maybe I can go back to www.MotorolaFans.com as a Developer

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...).

EDITED---
guess we have to take boot.img from CWM backup images?
Is this doable under Windows? I tried but unpackbootimg wasn't recognized as a command

Nice work mas bro....
Tari Kecak is Awesome... ^^

autotomy said:
EDITED---
guess we have to take boot.img from CWM backup images?
Is this doable under Windows? I tried but unpackbootimg wasn't recognized as a command
Click to expand...
Click to collapse
It's only for Linux and its variants and derivatives

autotomy said:
EDITED---
guess we have to take boot.img from CWM backup images?
Is this doable under Windows? I tried but unpackbootimg wasn't recognized as a command
Click to expand...
Click to collapse
EmoBoiix3 said:
It's only for Linux and its variants and derivatives
Click to expand...
Click to collapse
Under Windows you can use JDK + Cygwin Custom Package + dsixda kitchen. Head to dsixda kitchen thread for more info. It's built for HTC but usable for Galaxy Ace / Mini (unpack / repack boot.img)

iv tried to us JDK + Cygwin but once I build the boot.img and flash it my boot animations stop working dose anyone no why ?

Nice post
Sent from my GT-S5830 using xda premium

i really need help
i need someone how can extract boot.img add my cooper.rle to it and change the default.prop to this
ro.secure=0
thanks

rickwyatt said:
i really need help
i need someone how can extract boot.img add my cooper.rle to it and change the default.prop to this
ro.secure=0
thanks
Click to expand...
Click to collapse
Use Ubuntu , it'll be easier
Sent from my GT-S5830 using XDA App

First post and attachment updated! Read README.txt and unpack/repack scripts for more details.

ketut.kumajaya said:
First post and attachment updated! Read README.txt and unpack/repack scripts for more details.
Click to expand...
Click to collapse
Thanks Ketut,That might be useful For Me

ketut.kumajaya said:
First post and attachment updated! Read README.txt and unpack/repack scripts for more details.
Click to expand...
Click to collapse
Wow I can't thank you enough ketut !
Herpderp Adreno + Tegra.

nice..........

Incredible, thank you!

hi, guy. I want to short video.

autotomy said:
EDITED---
guess we have to take boot.img from CWM backup images?
Click to expand...
Click to collapse
Good point to ask, can I do this with normal boot.img or I really need boot.img from nandroid backup??

Related

[Q] initrd.gz repack

Does the initrd.gz need have permissions reset after unpacking and repacking???? I keep getting bootloops and im not sure what commands to run to set permissions. I use ubuntu any help would be greatly appreciated thanks!!!!!!!
I have the same problem, anyone can help?
You can try use Kitchen here:
http://forum.xda-developers.com/showthread.php?t=633246
blacksn said:
I have the same problem, anyone can help?
Click to expand...
Click to collapse
What commands are you using
The following command will do it for you
Code:
find .|cpio --quiet -H newc -o|gzip -9 -c - > ../initrd.gz
here is original initrd.gz from ROM and image that i want to put inside:
black.volyn.net/or.zip
here is the file i'm getting after command:
black.volyn.net/initrd.gz
(add http to links, i can't post links yet)
Image is changed, but the phone reboots when bootanimation must to start.
Can someone to pack me initrd.gz with image from archieve?
Try the link below
http://dl.dropbox.com/u/26430630/initrd.gz
Hopefully that will work for you
Thanks, works fine!
Which version of Linux did you use to make inird.gz?
blacksn said:
Thanks, works fine!
Which version of Linux did you use to make inird.gz?
Click to expand...
Click to collapse
I use sabayon, debian or ubuntu
The same command should work all linux machines

How to unpack, edit and repack boot.img

*** 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://forum.xda-developers.com/showthread.php?t=633246
IS YOUR dsixda kitchen FIX FOR MOTO ?
duansindo said:
IS YOUR dsixda kitchen FIX FOR MOTO ?
Click to expand...
Click to collapse
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
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
godson32 said:
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
Click to expand...
Click to collapse
Try the evo forum.

[OUTDATED GUIDE]Make Custom Rom Easier Than Cycling

Things you need:
Base firmware (i'm use Gingerbread S5830SERKPH 2.3.4)
Windows (I'm use windows 7 X64 service pack 1)
Linux (Ubuntu recommended)
And the last thing is, You need enough experience in android world
step-step :
Flash your phone with your desired base firmware.
Make required modifications at your phone.
After that, do hard reset to your phone.
Next back up system.rfs .
put system.rfs with boot.img, data.rfs, recovery.img from PDA base firmware in one folder.
After that, repack your custom rom.
what should we do to modify it :
Remove useless widgets
Add more apps
Change theme
How to back up System.rfs :
Download at market "terminal emulator"
next run this code:
Code:
su
dd if=/dev/stl12 of=/sdcard/system.rfs
How to hard reset your phone :
Move by root explorer your modification apps to system/app then change permission like this :
Code:
User:Read, Write
group:Read
Others:Read
Next change the owner to "root" by root explorer
At least boot into recovery mode "HOME+POWER" and choose "wipe data/factory reset" be sure your contact data already backup
How to repack your custom rom :
PDA by running this code via terminal at linux:
Code:
tar -H ustar -c boot.img recovery.img data.rfs system.rfs >> ROMNAME.tar
md5sum -t ROMNAME.tar >> ROMNAME.tar
mv ROMNAME.tar ROMNAME.tar.md5
change ROMNAME to your desired, of course, ROM name.
If you want to build One-Package ROM, just use 1st and 2nd command and don't forget to include all files on all *.tar.md5 (such as modem, csc, apboot) like this :
Code:
tar -H ustar -c *.* >> ROMNAME.tar
md5sum -t ROMNAME.tar >> ROMNAME.tar
How to change your rom name :
At root explorer you see at folder system "build.prop"
Open it in text editor edit "ro.build.display.id=GINGERBREAD.XXKPH" with your rom name
Another Handy Modification Guide:
How to edit system.rfs on your Pc :
importan : if you want to edit system.rfs at windows, DON'T use Magic Iso, why? because i was use it, then my system.rfs corrupt.
you must have linux (ubuntu recommended)
run it from terminal :
Code:
sudo mount -o loop system.rfs /some_dir
make required modification
then Unmount it
How to Unpacking & repacking the image :
Note: below I give you the details for unpacking and repacking manually, but I have attached two perl scripts that do most of this for you
If you are good with a hex editor, you can open up any of these images and strip off the first 2k of data. Then, look for a bunch of zeroes followed by the hex 1F 8B (which is the magic number of a gzip file). Copy everything from the first line of the file, through the zeroes, and stopping at the 1F 8B. That is the kernel. Everything from the 1F 8B through the end is the ramdisk. You could save each of these files separately. In order to see the contents of the ramdisk, you need to un-gzip it and then un-cpio it. You could use a command like this (ideally after creating a new directory and cd'ing into it):
Code:
gunzip -c ../your-ramdisk-file | cpio -i
That will place all of the files from the ramdisk in your working directory. You can now edit them.
In order to re-create the ramdisk, you need to re-cpio them and re-gzip those files, with a command like the following (remember, cpio will include everything in the current working directory, so you probably want to remove any other cruft you might have in there):
Code:
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
The final step is to combine the kernel and your new ramdisk into the full image, using the mkbootimg program (which you should download and compile from the git repository):
Code:
mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel your-kernel-file --ramdisk newramdisk.cpio.gz -o mynewimage.img
Now, there's a lot of hassle in pulling apart files in hex editors and remembering all of these commands, so I wrote unpack and repack perl scripts for you (attached). Hooray.
How to Manually deodex your phone :
What you'll need:
xUltimate v2.2
Unzip xUltimate v2.2, and launch "Main.exe"
If everything goes well xUlt should recognize the phone and make a connection. You now should see a list of options.
Run option 1. After option 1 is done, run option 2.
Now these well take a while. Run option 3.
IMPORTANT: After you have run option 3, you MUST navigate to the xUltimate folder and find "origi_frame" folder, and delete "guava.odex". It's a bad file, and interferes with deodexing process.
Now run option 4, and wait.
Exit xUltimate, and put the phone in USB mass storage.
Go back into the xUltimate folder and copy "done_frame", and "done_app", and move them to the root of the sdcard.
Put the phone in PC mode
Open a command prompt, and do the following:
Code:
adb shell
su
stop
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /sdcard/done_app/* /system/app/
cp /sdcard/done_frame/* /system/framework/
rm /system/app/*.odex
rm /system/framework/*.odex
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
reboot
Your phone should now be deodexed!
You may notice an increase in speed, and you now have the ability to edit certain files with greater effects.
How to change bootanimation :
using a Root explorer goto the /system/media directory.
Copy bootanimation.zip to your SD Card.
Connect your droid to your computer with usb and mount the SD Card
Copy bootanimation.zip to your computer.
extract bootanimation.zip to a folder
Inside you will find 2 folders with all the individual PNG files in them.
With photoshop or paint modify the png files to add your custom graphics, OR make/download your own pictures. (Make sure they are match with your phone device)
Highlight the two folders and the desc file.
Right click the highlighted files.
Select add files to archive.
Select Zip check box
In the compression method drop down box select Store. (this is key if you dont do this it wont play the animation)
save the archive as bootanimation.zip
copy the new bootanimation.zip to your SD Card
Select the bootanimation.zip file from your SD Card and move it... system>media>paste
________________
i'm just 12 years old if i can do it, why you can't
Advantages of this way is :
More efficient
Reduce your internet usage (dont need kitchen, apk manager, etc)
Easy to modification (You can see the direct result)
Reduce your time (only 2 hours i can do this way)
More soon
You steal my IDEAS Univos! No, just kidding, there are incorrect guide on "how to hard reset" lol. Anyway, try to build a ROM before creating this guide, my friend.
Wow Kids!
are doing development now a days
fla.sh said:
You steal my IDEAS Univos! No, just kidding, there are incorrect guide on "how to hard reset" lol. Anyway, try to build a ROM before creating this guide, my friend.
Click to expand...
Click to collapse
im not steal it.
Where is incorrect guide i'm try to fix it?
Sent from my GT-S5830 using XDA App
GadgetCheck said:
Wow Kids!
are doing development now a days
Click to expand...
Click to collapse
Thanks
Sent from my GT-S5830 using XDA App
This guide tested by me, and i have get result from this.
Sent from my GT-S5830 using XDA App
If you have question just ask me!
Sent from my GT-S5830 using XDA App
I think this guide is the same with fla.sh's guide.
devilsking said:
I think this guide is the same with fla.sh's guide.
Click to expand...
Click to collapse
Different, Fla.sh make guide for cooking his rom.
in this thread i tell you how to make your own custom rom.
with Phone device Samsung Galaxy Ace.
Univos said:
Different, Fla.sh make guide for cooking his rom.
in this thread i tell you how to make your own custom rom.
with Phone device Samsung Galaxy Ace.
Click to expand...
Click to collapse
ya ya. I see tks for your guide
devilsking said:
ya ya. I see tks for your guide
Click to expand...
Click to collapse
Please press thanks button, if i helped you
Sent from my GT-S5830 using XDA App
Univos said:
This guide tested by me, and i have get result from this.
Sent from my GT-S5830 using XDA App
Click to expand...
Click to collapse
Now that you're awesome like fla.sh , I'll be quietly tucking in a corner thinking how young teenagers get their knowledge . XD jkjk
EmoBoiix3 said:
Now that you're awesome like fla.sh , I'll be quietly tucking in a corner thinking how young teenagers get their knowledge . XD jkjk
Click to expand...
Click to collapse
Just kept reading, ask people, don't feel has a lot of knowledge, kept countinue to learn
Sent from my GT-S5830 using XDA App
EmoBoiix3 said:
Now that you're awesome like fla.sh , I'll be quietly tucking in a corner thinking how young teenagers get their knowledge . XD jkjk
Click to expand...
Click to collapse
Maybe this holiday i will developt a simple custom rom.
Sent from my GT-S5830 using XDA App
Univos said:
Maybe this holiday i will developt a simple custom rom.
Sent from my GT-S5830 using XDA App
Click to expand...
Click to collapse
I am thinking about a kid with two or more different XDA ID.
ketut.kumajaya said:
I am thinking about a kid with two or more different XDA ID.
Click to expand...
Click to collapse
No, the real name Fla.sh is "Aver..." my real name is "iz..." we are student of junior high school at surabaya. I'm "Aver..." friend.
Sent from my GT-S5830 using XDA App
Univos said:
No, the real name Fla.sh is "Aver..." my real name is "iz..." we are student of junior high school at surabaya. I'm "Aver..." friend.
Sent from my GT-S5830 using XDA App
Click to expand...
Click to collapse
I'm swear.
Sent from my GT-S5830 using XDA App
ketut.kumajaya said:
I am thinking about a kid with two or more different XDA ID.
Click to expand...
Click to collapse
ROFLAMO
Jukirdolly said:
ROFLAMO
Click to expand...
Click to collapse
??????
Sent from my GT-S5830 using XDA App

Request for framework-res.apk and SystemUI.apk

Hello
Can someone help me and share the framework-res.apk and SystemUI.apk from JOP40D Stock odexed ? Or at least tell me where I can download it.
Thank You.
marser said:
Hello
Can someone help me and share the framework-res.apk and SystemUI.apk from JOP40D Stock odexed ? Or at least tell me where I can download it.
Thank You.
Click to expand...
Click to collapse
You can find these things in the system.img provided by the JOP40D factory image for occam. I've added them to an archive and attached to this post.
Thank you. Just to increase my knowledge... How I can extract the *.img ?? I was looking over the net looking for it, but i couldn't do finally.
marser said:
Thank you. Just to increase my knowledge... How I can extract the *.img ?? I was looking over the net looking for it, but i couldn't do finally.
Click to expand...
Click to collapse
Try 7-zip. I believe it can. Also a super light weight program.
Sent from my GT-I9000 using xda premium
marser said:
Thank you. Just to increase my knowledge... How I can extract the *.img ?? I was looking over the net looking for it, but i couldn't do finally.
Click to expand...
Click to collapse
I can provide the steps to do this in Linux as that is what I'm familiar with.
The system.img file is a sparse ext4 image that needs to be unpacked before it can be mounted. This is done with a binary compiled from AOSP source. Here are the steps for that:
Code:
git clone https://android.googlesource.com/platform/system/core
cd core
git checkout android-4.2.1_r1
cd libsparse
gcc -o simg2img -Iinclude -lz simg2img.c sparse_crc32.c backed_block.c output_file.c sparse.c sparse_err.c sparse_read.c
Once the simg2img binary is compiled you can make use of it on a sparse image:
Code:
simg2img system.img system.unpacked.img
The resulting unpacked.img will be much larger than the sparse image but can now be mounted and it's contents traversed.
Code:
mount -t ext4 -o loop system.unpacked.img /mnt/unpacked_system
want framework and system ui
I want nexus 4's stock rom JB 4.2 frame work and system ui...

[Q] unpack orginal boot.img into kernel and ramdisk

Hello,
i have extended my orginal Kernel with following code lines to use a USB webcam (modified cam for astrophotography) with my Xperia Tablet Z SGP311 Android 4.4.2 stock rom.
CONFIG_VIDEO_DEV=y
CONFIG_VIDEO_V4L2_COMMON=y
CONFIG_VIDEO_MEDIA=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
#UVC driver support..
Click to expand...
Click to collapse
..for the zImage i have used the Tutorial and Toolchains from DooMLoRD :good:
..code lines into my fusion3_pollux_windy_defconfig
ARCH=arm CROSS_COMPILE=/home/xxxxxxxxxxxx/toolchains/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- make fusion3_pollux_windy_defconfig
Click to expand...
Click to collapse
..made my .config and compile
ARCH=arm CROSS_COMPILE=/home/xxxxxxxxxxxx/toolchains/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- make -j8
Click to expand...
Click to collapse
now have tried to unpack my orginal boot.img wich i have ripped like this Tutorial from Youtube User IT ADV with "abootimg" into kernel and ramdisk
[email protected]:~$ cd boot_sony
[email protected]:~/boot_sony$ ls
boot.img
[email protected]:~/boot_sony$ abootimg -x boot.img
boot.img: no Android Magic Value
boot.img: not a valid Android Boot Image.
[email protected]:~/boot_sony$
Click to expand...
Click to collapse
But everytime i get these errors
no Android Magic Value and not a valid Android Boot :crying:
And another trial
[email protected]:~$ cd boot_sony
[email protected]:~/boot_sony$ perl split_bootimg.pl boot.img
Android Magic not found in boot.img. Giving up.
[email protected]:~/boot_sony$
Click to expand...
Click to collapse
Hmm, why i cant unpack boot.img?
I have tried a different boot.img from my Galaxy S2 Slimrom with the same error.

Categories

Resources