@@ -919,7 +919,7 @@ def generate_empty_partition_image(binary_path, image_size):
919
919
env .Depends ("$BUILD_DIR/$PROGNAME$PROGSUFFIX" , empty_partition )
920
920
921
921
922
- def get_partition_info (pt_path , pt_offset , pt_params ):
922
+ def get_partition_info (pt_path , pt_params ):
923
923
if not os .path .isfile (pt_path ):
924
924
sys .stderr .write (
925
925
"Missing partition table file `%s`\n " % os .path .basename (pt_path )
@@ -930,8 +930,6 @@ def get_partition_info(pt_path, pt_offset, pt_params):
930
930
env .subst ("$PYTHONEXE" ),
931
931
os .path .join (FRAMEWORK_DIR , "components" , "partition_table" , "parttool.py" ),
932
932
"-q" ,
933
- "--partition-table-offset" ,
934
- hex (pt_offset ),
935
933
"--partition-table-file" ,
936
934
pt_path ,
937
935
"get_partition_info" ,
@@ -940,8 +938,13 @@ def get_partition_info(pt_path, pt_offset, pt_params):
940
938
"offset" ,
941
939
]
942
940
943
- if pt_params ["name" ] == "boot" :
944
- cmd .append ("--partition-boot-default" )
941
+ if pt_params ["name" ]:
942
+ if pt_params ["name" ] == "*boot" :
943
+ cmd .append ("--partition-boot-default" )
944
+ else :
945
+ cmd .extend ([
946
+ "--partition-name" , pt_params ["name" ]
947
+ ])
945
948
else :
946
949
cmd .extend (
947
950
[
@@ -955,8 +958,8 @@ def get_partition_info(pt_path, pt_offset, pt_params):
955
958
result = exec_command (cmd )
956
959
if result ["returncode" ] != 0 :
957
960
sys .stderr .write (
958
- "Couldn't extract information for %s/%s from the partition table \n "
959
- % (pt_params [ "type" ], pt_params [ "subtype" ] )
961
+ "Couldn't extract information for {%s} from %s \n "
962
+ % (pt_params , pt_path )
960
963
)
961
964
sys .stderr .write (result ["out" ] + "\n " )
962
965
sys .stderr .write (result ["err" ] + "\n " )
@@ -969,12 +972,6 @@ def get_partition_info(pt_path, pt_offset, pt_params):
969
972
return {"size" : size , "offset" : offset }
970
973
971
974
972
- def get_app_partition_offset (pt_table , pt_offset ):
973
- # Get the default boot partition offset
974
- app_params = get_partition_info (pt_table , pt_offset , {"name" : "boot" })
975
- return app_params .get ("offset" , "0x10000" )
976
-
977
-
978
975
def install_python_deps ():
979
976
def _get_installed_pip_packages ():
980
977
result = {}
@@ -1285,8 +1282,7 @@ def _skip_prj_source_files(node):
1285
1282
env .Depends ("$BUILD_DIR/$PROGNAME$PROGSUFFIX" , partition_table )
1286
1283
1287
1284
# linker needs APP_OFFSE and APP_SIZE
1288
- partition_table_offset = sdk_config .get ("PARTITION_TABLE_OFFSET" , 0x8000 )
1289
- app_params = get_partition_info (env .subst ("$PARTITIONS_TABLE_CSV" ), partition_table_offset , {"name" : "boot" })
1285
+ app_params = get_partition_info (env .subst ("$PARTITIONS_TABLE_CSV" ), {"name" : "*boot" })
1290
1286
app_offset = app_params .get ("offset" )
1291
1287
app_size = app_params .get ("size" )
1292
1288
env .Replace (
@@ -1356,7 +1352,6 @@ def _skip_prj_source_files(node):
1356
1352
1357
1353
ota_partition_params = get_partition_info (
1358
1354
env .subst ("$PARTITIONS_TABLE_CSV" ),
1359
- partition_table_offset ,
1360
1355
{"name" : "ota" , "type" : "data" , "subtype" : "ota" },
1361
1356
)
1362
1357
0 commit comments