Lines Matching refs:partition
59 print "Duplicated partition number:%d" % (partition["num"])
67 def write_partition(partition, output_file, offset): argument
70 dd_comm = ['dd', 'if='+partition["path"], 'of='+output_file,'conv=notrunc,sync',
75 def unsparse_partition(partition): argument
78 print "Unsparsing %s" % (partition["path"]),
79 partition["fd"], temp_file = mkstemp()
80 shell_command([simg2img, partition["path"], temp_file])
81 partition["path"] = temp_file
91 def add_partition(partition, output_file): argument
93 num = str(partition["num"])
94 new_comm = '--new='+num+':'+partition["start"]+':'+partition["end"]
96 name_comm = '--change-name='+num+':'+partition["label"]
131 for partition in partitions:
133 partition["start"] = str(offset / 512)
135 if check_sparse(partition["path"]):
136 unsparse_partition(partition)
140 write_partition(partition, output_filename, offset/1024/1024)
142 partition["end"] = str(offset / 512 - 1)
155 for partition in partitions:
156 add_partition(partition, output_filename)
158 if 'fd' in partition:
159 os.close(partition["fd"])
160 os.remove(partition["path"])