6/05/2012

eMMC Sparse Image Download in the MSM8x60

Question: eMMC Sparse Image Download using checksparse python script




Answer:

Following 3 tools are needed:
1. ptool.py
2. checksparse.py (new)
3. msp.py


All the above tools are located at : \modem_proc\core\storage\tools\jsdcc\partition_load_pt\

For checksparse.py to work, looks for the tag sparse="true" in rawprogram0.xml. That is, the original partition.xml file must have marked the file as sparse, and when ptool.py parses this file, this sparse tag will be propagated to rawprogram0.xml




For eg:
partition.xml
<extended order="9" type="83" label="USERDATA" size="12165824" readonly="false" sparse="true">
<file name="userdata.img.ext4" offset="0"/>
</extended>



rawprogram0.xml
<program file_sector_offset="0" filename="userdata.img.ext4" label="USERDATA" num_partition_sectors="12165824" physical_partition_number="0" size_in_KB="5940.0" sparse="true" start_byte_hex="0x84800" start_sector="1060"/>





Run checksparse.py as follows:
python checksparse.py -i rawprogram0.xml -p C:\path1 -p C:\path2 -p C:\path3
where, C:\path1 etc: path(s) to the sparse image(s)

NOTE: If the original rawprogram0.xml is to be preserved, an output filename can be specified as follows:
python checksparse.py -i rawprogram0.xml -o rawprogram0_unsparse.xml -p C:\path1 -p C:\path2 -p C:\path3




Output will be:

No sparse images found
OR
FOUND: sparse file found userdata.img.ext4
SUCCESS: Created "rawprogram0.xml"

If the above successful message is seen, it means the rawprogram.xml had at least 1 sparse image
The rawprogram.xml is now updated to be able to program it

Finally, run T32, msp.py or QPST to program it as normal.

4 comments:

  1. While compiling JB from code aurora sources I am getting this error. May be u can help ?

    make: *** No rule to make target `out/host/linux-x86/bin/checksparse.py', needed by `out/target/product/msm7627a/obj/PACKAGING/target_files_intermediates/msm7627a-target_files-eng.arun.zip'. Stop.
    make: *** Waiting for unfinished jobs....

    ReplyDelete
    Replies
    1. You should check you build envionment, please refer to http://www.anyclub.org/2011/10/android-gingerbread-build-envionment.html

      Delete
  2. Hi,
    Thanks for all the useful info you post, you are amazing!
    You are the last person that might help me.
    There are some files (system_1.unsparse, system_2.unsparse, ...) in a custom flash build.


    Is there a way to pack them back as a single file (e.g. system.img)?

    I tried your method with emmcswdownload.exe -f on QPST 2.7.402 but it didn't work.

    Or is there a way to mount them in Linux or Windows?
    My purpose is to unpack and repack the image file to customize my own build.

    Thanks a lot in advance.
    Morteza

    ReplyDelete