FORUMS

[TOOL] Boot.img tools [unpack, repack, ramdisk]

9,009 posts
Thanks Meter: 14,059
 
By CNexus, Senior Member on 11th June 2013, 03:00 AM
Post Reply Email Thread
10th October 2013, 02:37 AM |#11  
twins.7's Avatar
Senior Member
Thanks Meter: 68
 
More
Quote:
Originally Posted by CNexus

I'm not sure. No tool will work for all devices, and since I've never had a device that has this special packing, it would be best if you asked one of your kernel devs for help unpacking/repacking

ok thank's
12th October 2013, 05:56 PM |#12  
Ricky Divjakovski's Avatar
Recognized Developer / Recognized Contributor
Flag Sydney
Thanks Meter: 7,658
 
Donate to Me
More
Quote:
Originally Posted by CNexus

I have not seen this posted anywhere, so I thought I would post it here. This is NOT purely my work, and I do not take credit for it as such.

Included in the attached ZIP are the following files:

  • boot_info - prints information about the boot.img passed to it, including the base address and ramdisk address. This tool prints out everything needed to repack the boot.img correctly.
  • split_boot - More commonly known as split_bootimg.pl, this rips apart the boot.img to extract the ramdisk and zImage. It has been modified by me to split the boot.img into a separate folder (specified by the file name of the boot.img passed to it) and to extract the ramdisk into a sub-folder as well (extracts the cpio from the gz and then extracts the actual files from the cpio archive)
  • unpack_ramdisk - unpacks the given ramdisk file.
    Code:
    Usage: unpack_ramdisk <ramdiskFile>
  • repack_ramdisk - repacks the ramdisk from the given directory (found online and modified slightly to take a directory)
    Code:
    Usage: repack_ramdisk <ramdiskDirectory> [outputFile]
  • mkbootimg - mkbootimg binary that creates a boot.img file from the given ramdisk and zImage. Updated to a version compiled by me to support the --ramdiskaddr option (ramdisk address) so that even nonstandard boot.img's can be repacked correctly (Use with boot_info for best results).
  • umkbootimg - included for convenience. Not made by me. Original thread here.
  • unpack - wrapper script made by me for the umkbootimg binary^ to unpack the boot.img into a separate directory and then unpack the ramdisk into a sub-directory.

Note: These tools were made for Linux. They may also work on Cygwin, but I have not personally tested them.

ANYONE is free to use / modify / kang these files as they see fit. No need to ever ask or do anything more than download.

Enjoy.

is it possible to make these run on the device?
i have tried

adb root
adb remount
adb push * /sdcard/tmp/
adb push * /system/xbin/
adb push * /system/bin/
adb shell
cd /sdcard/tmp/
for f in $(ls)
do
chmod 755 /system/bin/$f
chmod 775 /system/xbin/$f
done
cd /
rm -r /sdcard/tmp
cd /sdcard/working
split_bootimg.pl boot.img

returns "Permission denied"

hmmmmm???????? what could be the problem????????
12th October 2013, 07:32 PM |#13  
CNexus's Avatar
OP Senior Member
Flag ~/android
Thanks Meter: 14,059
 
Donate to Me
More
Quote:
Originally Posted by ricky310711

is it possible to make these run on the device?
i have tried

adb root
adb remount
adb push * /sdcard/tmp/
adb push * /system/xbin/
adb push * /system/bin/
adb shell
cd /sdcard/tmp/
for f in $(ls)
do
chmod 755 /system/bin/$f
chmod 775 /system/xbin/$f
done
cd /
rm -r /sdcard/tmp
cd /sdcard/working
split_bootimg.pl boot.img

returns "Permission denied"

hmmmmm???????? what could be the problem????????

The Perl script should work if you have Perl (compiled for ARM x86) on your device.

The binaries will not work as they are not compiled for ARM. The scripts (at least some of them) should work if you change all instances of "#!/bin/bash" and "#!/usr/bin/env bash" to "#!/system/bin/sh".
13th October 2013, 08:55 AM |#14  
Ricky Divjakovski's Avatar
Recognized Developer / Recognized Contributor
Flag Sydney
Thanks Meter: 7,658
 
Donate to Me
More
Quote:
Originally Posted by CNexus

The Perl script should work if you have Perl (compiled for ARM x86) on your device.

The binaries will not work as they are not compiled for ARM. The scripts (at least some of them) should work if you change all instances of "#!/bin/bash" and "#!/usr/bin/env bash" to "#!/system/bin/sh".

will see if i can get it working tonight! this could be pretty good if i can get it to unpack on device!
13th October 2013, 03:03 PM |#15  
CNexus's Avatar
OP Senior Member
Flag ~/android
Thanks Meter: 14,059
 
Donate to Me
More
Quote:
Originally Posted by ricky310711

will see if i can get it working tonight! this could be pretty good if i can get it to unpack on device!

No need...download this zip and extract http://www12.zippyshare.com/v/37266634/file.html

It already contains an unmkbootimg binary compiled for ARM. Then you would just need to unpack the ramdisk to finish it off.
13th October 2013, 03:31 PM |#16  
Ricky Divjakovski's Avatar
Recognized Developer / Recognized Contributor
Flag Sydney
Thanks Meter: 7,658
 
Donate to Me
More
Quote:
Originally Posted by CNexus

No need...download this zip and extract http://www12.zippyshare.com/v/37266634/file.html

It already contains an unmkbootimg binary compiled for ARM. Then you would just need to unpack the ramdisk to finish it off.

no way, ive been looking for something like this for ages, who is the author?
13th October 2013, 03:48 PM |#17  
CNexus's Avatar
OP Senior Member
Flag ~/android
Thanks Meter: 14,059
 
Donate to Me
More
Quote:
Originally Posted by ricky310711

no way, ive been looking for something like this for ages, who is the author?

I don't know who originally compiled that unmkbootimg binary for ARM.
The Following User Says Thank You to CNexus For This Useful Post: [ View ] Gift CNexus Ad-Free
13th October 2013, 03:50 PM |#18  
Ricky Divjakovski's Avatar
Recognized Developer / Recognized Contributor
Flag Sydney
Thanks Meter: 7,658
 
Donate to Me
More
Quote:
Originally Posted by CNexus

I don't know who originally compiled that unmkbootimg binary for ARM.

hmm, gotta findout! i wanna use it in my tool!
The Following User Says Thank You to Ricky Divjakovski For This Useful Post: [ View ]
30th December 2013, 11:25 PM |#19  
Senior Member
Thanks Meter: 99
 
More
Is this boot.img tool compatible with Microsoft windows as well?

Sent from my SPH-L710 using XDA Premium 4 mobile app
12th January 2014, 06:09 PM |#20  
CNexus's Avatar
OP Senior Member
Flag ~/android
Thanks Meter: 14,059
 
Donate to Me
More
Quote:
Originally Posted by shakim24

Is this boot.img tool compatible with Microsoft windows as well?

Sent from my SPH-L710 using XDA Premium 4 mobile app

Read the OP.
mantalamo
23rd January 2014, 04:45 AM |#21  
Guest
Thanks Meter: 0
 
More
Beginner me
are these tools would be enough to edit/modify something in the boot.img? This will be my first attempt. My purpose is to change the boot splash image of a Kernel. With my intent to use this tool, would these suffice my needs? Thanks
Post Reply Subscribe to Thread

Tags
boot.img, boot.img modify, boot.img splitting, ramdisk, split boot.img

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes