FORUMS

Samsung Galaxy Alpha (SM-G850) Gets Android 5.0

An Android 5.0 Lollipop update is finally available to download for the Samsung Galaxy … more

Do You Use 4:3 or 16:9 in the Camera App?

Every person has their own method of taking the best photos on their devices, but which aspect … more

LG G4 XDA Forum Opened

LG’s latest & greatest is just a few hours away from launching, and with so many power users that are … more

Android Wear Close to Running on Samsung Gear 2

Android is an OS that can sometimes be ported to run on devices not designed to … more
Post Reply Subscribe to Thread Email Thread

[tool] ANDROID_IMG_REPACK_TOOLS

6th January 2014, 09:54 PM |#1  
A.S._id's Avatar
OP Recognized Developer
Thanks Meter: 2,277
 
More
[tool] ANDROID_IMG_REPACK_TOOLS


android_img_repack_tools is a kit utilites for unpack/repack android ext4 and boot images in LINUX & WINDOWS


includes binaries:
mkbootfs
simg2simg
make_ext4fs
mkbootimg
ext2simg
simg2img
img2simg
sgs4ext4fs - Chainfire's tool
unpackbootimg - CyanogenMod tool
mkbootimg_tools - xiaolu




sources used:
https://android.googlesource.com
https://github.com/CyanogenMod/android_system_core.git
https://github.com/Chainfire/sgs4ext4fs





how to make:

Preparation OS:

Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.8-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline6-dev gcc-multilib g++-multilib libc6-dev x11proto-core-dev libx11-dev libz-dev gawk texinfo automake libtool cvs libsdl-dev
Dowload repo:

Code:
git clone https://github.com/ASdev/android_img_repack_tools
Choose branch, for example:

Code:
cd android_img_repack_tools
git checkout android-4.4.4_r2.0.1
Building tools:

Code:
./configure
will download source from android git repositories

Code:
make
will compille binaries: mkbootfs simg2simg make_ext4fs mkbootimg sgs4ext4fs unpackbootimg ext2simg img2simg simg2img

Code:
make clean
will remove binaries

Code:
make clear
wiil remove sources

credits:
android.googlesource
Chainfire
CyanogenMod


go to the repository

Already have a branch:
android-2.3.7_r1
android-4.0.4_r2.1
android-4.1.2_r2.1
android-4.2.2_r1.2
android-4.3_r3.1
android-4.4.2_r1
android-4.4.3_r1.1.0.1
android-4.4.4_r2.0.1
android-5.0.0_r2
android-5.0.2_r1
android-5.1.0_r1
android-5.1.0_r3


Usage:

Code:
## Converting sparse flashing system.img from flashing android sparse img to ext4 img

$ simg2img system.img system.raw.img
## or all parts of sparse img
$ simg2img system.img* system.raw.img

## Mounting ext4 img for edit

$ mkdir system_mnt
$ mount -t ext4 -o loop system.raw.img system_mnt
Code:
## Creating new android sparse img for flashing (android 2.3.6-4.2)

$ mkuserimg.sh -s system_mnt system_new.img ext4 ./temp [size partition MB for example 1024M]
## or
$ make_ext4fs -s -l 1024M system_new.img system_mnt
Code:
## Converting ext4 img to sparse img for flashing (android 4.3-etc)

$ ext2simg -v system.raw.img system_new.img
Code:
## Changing sparse img header size from 28bit to 32bit (for Samsung Exynos Octa)

$ sgs4ext4fs --bloat system_new.img system_32bit.img
Code:
## Remove Moto extra header... (for Motorola G-series, making after unsparse img)

$ mv system.raw.img system.moto.img
$ dd if=system.moto.img of=system.raw.img ibs=131072 skip=1



Experimental:
android_5.1_img_repack_tools_CYGWIN (beta)


android_5.1_img_repack_tools_CYGWIN is a kit utilites for unpack/repack android ext4 and boot images in WINDOWS


mkbootfs.exe
simg2simg.exe
make_ext4fs.exe
mkbootimg.exe
ext2simg.exe
img2simg.exe
simg2img.exe
sgs4ext4fs.exe - Chainfire's tool
unpackbootimg.exe - CyanogenMod tool


Google Drive






XDA:DevDB Information
android_img_repack_tools, Tool/Utility for the Android General

Contributors
A.S._id

Version Information
Status: Testing

Created 2014-01-06
Last Updated 2015-04-27
Last edited by A.S._id; 26th October 2014 at 01:18 PM.
The Following 50 Users Say Thank You to A.S._id For This Useful Post: [ View ]
 
 
6th January 2014, 09:54 PM |#2  
A.S._id's Avatar
OP Recognized Developer
Thanks Meter: 2,277
 
More
Odin3 ROM Editor
Odin3 ROM Editor

sources used:

sgs4ext4fs - Chainfire's tool
CWM / TWRP / MobileODIN installable ZIP: http://download.chainfire.eu/supersu
android_img_repack_tools - ASdev
mkbootimg_tools - xiaolu


Odin3 ROM Editor - it's a smart tool for:

* Extract/repacking zip/.tar.md5 ROM files
* Unpacking/mounting/repacking ext4 sparse partition image files
* Unpacking/repacking boot image files
in LINUX OS



Lesson 1 - Editing SM-N9005 Stock ROM



Lesson 2 - Editing I9300 Stock ROM. Adding Root permissions



DOWNLOAD



credits:
android.googlesource
Chainfire
Chenglu
Last edited by A.S._id; 26th April 2015 at 10:33 PM.
The Following 16 Users Say Thank You to A.S._id For This Useful Post: [ View ]
6th January 2014, 09:54 PM |#3  
A.S._id's Avatar
OP Recognized Developer
Thanks Meter: 2,277
 
More
MOTO_G_sparse_img_editor
MOTO_G_sparse_img_editor

Editor images for MOTO G for Linux x64
(If necessary under the x32 folder android_img_repack_tools is the source can compile the source code):
Code:
make clean
make

Instructions:
1. Download \ extract the archive
2. In the extracted folder to put all parts of the firmware images without sticking together!
3. Start main_menu in the terminal, select 1 - convert & mount img enter the name of the image without the extension! (system for example)
The tool will gather converts into a normal part of ext4, remove MOTO extra header and mount it in a folder system.mnt
4. After all the manipulations with the files, you can convert back to sparse img for flash via fastboot, selecting the menu item 2 - build sparse ext4img

DWNLOAD
Last edited by A.S._id; 17th March 2015 at 10:27 PM.
The Following 6 Users Say Thank You to A.S._id For This Useful Post: [ View ]
8th January 2014, 10:52 AM |#4  
Member
Thanks Meter: 22
 
More
mod edit
Thank you very much. I'm waiting for you.
Last edited by mark manning; 8th January 2014 at 02:28 PM.
The Following User Says Thank You to linhbs For This Useful Post: [ View ]
8th January 2014, 12:08 PM |#5  
A.S._id's Avatar
OP Recognized Developer
Thanks Meter: 2,277
 
More
Quote:
Originally Posted by linhbs

Thank you very much. I'm waiting for you.

But what are you waiting?
And why to copy all post?
The Following 3 Users Say Thank You to A.S._id For This Useful Post: [ View ]
8th January 2014, 01:23 PM |#6  
Member
Thanks Meter: 22
 
More
Thanks you. I got it!
8th January 2014, 04:28 PM |#7  
A.S._id's Avatar
OP Recognized Developer
Thanks Meter: 2,277
 
More
added branches:
android-2.3.7_r1
android-4.0.4_r2.1
android-4.2.2_r1.2
android-4.3_r3.1
android-4.4.2_r1
The Following 3 Users Say Thank You to A.S._id For This Useful Post: [ View ]
12th January 2014, 09:51 AM |#8  
Member
Thanks Meter: 4
 
More
Some headers missed. I am using Ubintu 12.04 and installed zlib1g-dev for compiling zlib_host. But make_ext4fs don't compiling:

Building make_ext4fs...
extras/ext4_utils/make_ext4fs.c: In function 'build_directory_structure':
extras/ext4_utils/make_ext4fs.c:175:27: error: 'struct stat' has no member named 'st_stat'
extras/ext4_utils/make_ext4fs.c:176:26: error: 'struct stat' has no member named 'st_stat'
extras/ext4_utils/make_ext4fs.c:177:26: error: 'struct stat' has no member named 'st_stat'
make: *** [make_ext4fs] Error 1
12th January 2014, 10:05 AM |#9  
A.S._id's Avatar
OP Recognized Developer
Thanks Meter: 2,277
 
More
Quote:
Originally Posted by MATPOC

Some headers missed. I am using Ubintu 12.04 and installed zlib1g-dev for compiling zlib_host. But make_ext4fs don't compiling:

Building make_ext4fs...
extras/ext4_utils/make_ext4fs.c: In function 'build_directory_structure':
extras/ext4_utils/make_ext4fs.c:175:27: error: 'struct stat' has no member named 'st_stat'
extras/ext4_utils/make_ext4fs.c:176:26: error: 'struct stat' has no member named 'st_stat'
extras/ext4_utils/make_ext4fs.c:177:26: error: 'struct stat' has no member named 'st_stat'
make: *** [make_ext4fs] Error 1

Well you has two ways:
This http://www.zlib.net/
or
Code:
make clean
make clear
./configure
cd ./zlib/src
./configure
make
sudo make install
cd ../..
make clean
make
Last edited by A.S._id; 12th January 2014 at 10:12 AM.
The Following 3 Users Say Thank You to A.S._id For This Useful Post: [ View ]
12th January 2014, 11:46 AM |#10  
Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by A.S._id

Well you has two ways:
This http://www.zlib.net/

As I said I have compiled zlib_host by installing zlib1g-dev. Compile broken at ext4fs - maybe there are no extra headers for ext4fs, such as for struct stat.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes