[HTC Desire 526] BigCountry907:
Lets Build

The first tool is ptool.py

We run some commands against the partition.xml to generate the rest of the files.

If you type python ptool.py in the terminal it will give you the commands it can use.

bigcountry907@bigcountry907-G551JW:~/Desktop/526-Completed/Build-Target$ python ptool.py
Created "zeros_1sector.bin"	<-- full of binary zeros - used by "wipe" rawprogram files
Created "zeros_33sectors.bin"	<-- full of binary zeros - used by "wipe" rawprogram files
Created "wipe_rawprogram_PHY0.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY1.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY2.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY4.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY5.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY6.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY7.xml"	<-- Used to *wipe/erase* partition information

==============================================================================
Basic Usage
==============================================================================

python ptool.py -x partition.xml

==============================================================================
Advanced Usage
==============================================================================

Basic Usage	python ptool.py -x partition.xml
Search path to find partition.xml	python ptool.py -x partition.xml -s c:\windows
Specify PHY Partition 0, (creates rawprogram0.xml)	python ptool.py -x partition.xml -p 0
Specify PHY Partition 1, (creates rawprogram1.xml)	python ptool.py -x partition.xml -p 1
Specify PHY Partition 2, (creates rawprogram2.xml)	python ptool.py -x partition.xml -p 2
Verbose output	python ptool.py -x partition.xml -v
Specify place to put output	python ptool.py -x partition.xml -t c:\temp
bigcountry907@bigcountry907-G551JW:~/Desktop/526-Completed/Build-Target$

Were just going to run the following command.

cd ~/Desktop/526-Completed/Build-Target
python ptool.py -x partition.xml

You should see this.

Created "gpt_main0.bin"	<-- Primary GPT partition tables + protective MBR
Created "gpt_backup0.bin"	<-- Backup GPT partition tables
Created "gpt_both0.bin"	<-- you can run 'perl parseGPT.pl gpt_both0.bin'

Created "rawprogram0.xml"	<-- YOUR partition information is HERE
Created "rawprogram0_BLANK.xml"	<-- Wipe out your images with this file (if needed for testing)
Created "patch0.xml"	<-- Tailor your partition tables to YOUR device with this file

Created "zeros_1sector.bin"	<-- full of binary zeros - used by "wipe" rawprogram files
Created "zeros_33sectors.bin"	<-- full of binary zeros - used by "wipe" rawprogram files
Created "wipe_rawprogram_PHY0.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY1.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY2.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY4.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY5.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY6.xml"	<-- Used to *wipe/erase* partition information
Created "wipe_rawprogram_PHY7.xml"	<-- Used to *wipe/erase* partition information
bigcountry907@bigcountry907-G551JW:~/Desktop/526-Completed/Build-Target$

You will notice that if you scroll up we can see what was processed for each partition.

Now were ready for our next operation.

Update the sparse data.

checksparse.py

bigcountry907@bigcountry907-G551JW:~/Desktop/526-Completed/Build-Target$ python checksparse.py

Usage: python simg2img.py [OPTION...]
Parses the sparse images from the input xml and generates the output chunks
as well as the new xml.

Examples:
# Look for sparse images in rawprogram0.xml, create update rawprogram0.xml

Options:

-i, --input=FILE rawprogram0.xml
-o, --output=FILE new rawprogram0.xml
-s, --search_path=PATH path to sparse image
-t, --location=PATH path to store the unsparsed images
-?, --help give this help list

Example

python checksparse.py -i rawprogram0.xml -s C:\path1 -s C:\path2 -s C:\path3
python checksparse.py -i rawprogram0.xml -s C:\path1 -s C:\path2 -o rawprogram00.xml

bigcountry907@bigcountry907-G551JW:~/Desktop/526-Completed/Build-Target$

We will run this command.

python checksparse.py -i rawprogram0.xml

bigcountry907@bigcountry907-G551JW:~/Desktop/526-Completed/Build-Target$ python checksparse.py -i rawprogram0.xml

Looking for rawprogram0.xml
----------------------------------------
Searching /home/bigcountry907/Desktop/526-Completed/Build-Target

**Found rawprogram0.xml (16083 bytes)

FOUND: sparse file found system.img

Looking for system.img
----------------------------------------
Searching /home/bigcountry907/Desktop/526-Completed/Build-Target

**Found system.img (2065799956 bytes)
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_1.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_2.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_3.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_4.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_5.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_6.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_7.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_8.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_9.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_10.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_11.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_12.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_13.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_14.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_15.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_16.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_17.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_18.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_19.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_20.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_21.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_22.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_23.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_24.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_25.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_26.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_27.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_28.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_29.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_30.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_31.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_32.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_33.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_34.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_35.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_36.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_37.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_38.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_39.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/system_40.img

FOUND: sparse file found userdata.img

Looking for userdata.img
----------------------------------------
Searching /home/bigcountry907/Desktop/526-Completed/Build-Target

**Found userdata.img (70796564 bytes)
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_1.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_2.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_3.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_4.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_5.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_6.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_7.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_8.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_9.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_10.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_11.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_12.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_13.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_14.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_15.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_16.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_17.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_18.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_19.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_20.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_21.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_22.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_23.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_24.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_25.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_26.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_27.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_28.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_29.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_30.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_31.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_32.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_33.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_34.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_35.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_36.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_37.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_38.img
creating /home/bigcountry907/Desktop/526-Completed/Build-Target/userdata_39.img

Found 2 files

Backing up 'rawprogram0.xml' to 'rawprogram0.xml.bak'

SUCCESS: Created "rawprogram0.xml"
bigcountry907@bigcountry907-G551JW:~/Desktop/526-Completed/Build-Target$

Now you can see all of these files have been created.

Awesome :cowboy: