I want to understand num_partition_sectors and start_sector to create rawprogram0.xml or rawprogram_unsparse.xml from system.img of android rom QFIL???
For Example: I have rawprogram0.xml from android ROM QFIL, in which
<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="system.img" label="system" num_partition_sectors="262144" physical_partition_number="0" start_sector="1054720" />
and
system.img file size is 128 MB (134,217,728 bytes).
In linux ubuntu, I know how to edit system.img file after mounting in ubuntu and so on. if I add some apk its size must be increase that's not big deal but problem for me is I do not know how to calculate num_partition_sectors and start_sector to create rawprogram0.xml or rawprogram_unsparse.xml from system.img (anysize)?? I am editing one original android ROM QFIL as per my need???
I need your kind help, any linux commands or Program which can calculate num_partition_sectors and start_sector from system.img file or any other way??
Please if you give me little explanation and calculation of above example, I am very thankful to you.
size_in_KB = SECTOR_SIZE_IN_BYTES x num_partition_sectors (kbyte) ----- > (byte)