File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,18 @@ def reconstruct_from_pcaps(
232232
233233 ota_chunks [image_key ].add ((offset , data ))
234234
235+ unknown_sizes = set ()
236+
237+ for key in ota_chunks :
238+ if key in ota_sizes :
239+ continue
240+
241+ unknown_sizes .add (key )
242+ ota_sizes [key ] = max (offset + len (data ) for offset , data in ota_chunks [key ])
243+ LOGGER .error (
244+ "Image size for %s not captured, assuming size %s" , key , ota_sizes [key ]
245+ )
246+
235247 for image_key , image_size in ota_sizes .items ():
236248 image_version , image_type , image_manuf_code = image_key
237249 print (
@@ -283,6 +295,7 @@ def reconstruct_from_pcaps(
283295
284296 filename = output_root / (
285297 f"ota_t{ image_type } _m{ image_manuf_code } _v{ image_version } "
298+ f"{ '_unk_size' if image_key in unknown_sizes else '' } "
286299 f"{ '_partial' if missing_ranges else '' } .ota"
287300 )
288301
You can’t perform that action at this time.
0 commit comments