diff options
author | Scott Anderson <saa@android.com> | 2012-02-07 10:29:20 -0800 |
---|---|---|
committer | Scott Anderson <saa@android.com> | 2012-02-08 17:33:59 -0800 |
commit | 3abb047eff3af8cfbdbf27a9433a250507541523 (patch) | |
tree | 7bfda23069844b3a9d67e18c41123f2fbc27ffec /ext4_utils/Android.mk | |
parent | 1645d7678182cfeb0d535b40de7fa66f0ca9f8cf (diff) | |
download | extras-3abb047eff3af8cfbdbf27a9433a250507541523.tar.gz |
Add img2simg tool that splits a large image into <n> sparse files
img2simg can take a large binary and chop it into multiple sparse
images. Each sparse image that is output has two chunks: a Don't
Care chunk to offset to where the data should be placed, and a
Raw chunk that actually contains the data to be placed there.
So, for example, if you have a 12 GB random file that you want to
place into userdata for testing e-MMC, you can run img2simg on it
to chop it into multiple sparse files and then "fastboot flash
userdata" on each of the sparse files.
Usage: img2simg [OPTIONS] <raw_image_file>
The <raw_image_file> will be split into as many sparse
files as needed. Each sparse file will contain a single
DONT CARE chunk to offset to the correct block and then
a single RAW chunk containing a portion of the data from
the raw image file. The sparse files will be named by
appending a number to the name of the raw image file.
OPTIONS (Defaults are enclosed by square brackets):
-s SUFFIX Format appended number with SUFFIX [%03d]
-B SIZE Use a block size of SIZE [4K]
-C SIZE Use a chunk size of SIZE [64M]
SIZE is a decimal integer that may optionally be
followed by a suffix that specifies a multiplier for
the integer:
c 1 byte (the default when omitted)
w 2 bytes
b 512 bytes
kB 1000 bytes
K 1024 bytes
MB 1000*1000 bytes
M 1024*1024 bytes
GB 1000*1000*1000 bytes
G 1024*1024*1024 bytes
Change-Id: I5593be1c195e04d83c99454e996763b841951dd7
Signed-off-by: Scott Anderson <saa@android.com>
Diffstat (limited to 'ext4_utils/Android.mk')
-rw-r--r-- | ext4_utils/Android.mk | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext4_utils/Android.mk b/ext4_utils/Android.mk index 3f82e4e8..ab0f26b2 100644 --- a/ext4_utils/Android.mk +++ b/ext4_utils/Android.mk @@ -95,6 +95,25 @@ LOCAL_MODULE := simg2img include $(BUILD_EXECUTABLE) +ifeq ($(HOST_OS),linux) +# Darwin doesn't have endian.h, and img2simg is just a convenience +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := img2simg.c +LOCAL_MODULE := img2simg +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) +endif + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := img2simg.c +LOCAL_MODULE := img2simg +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) + include $(CLEAR_VARS) LOCAL_SRC_FILES := setup_fs.c LOCAL_MODULE := setup_fs |