parttool: fix extra_partition_subtypes attribute parsing

This commit is contained in:
harshal.patil 2022-09-13 14:07:14 +05:30
parent 29830f609d
commit aca27c8db2
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ def gen_header_file(path: str, subtypes: str) -> None:
f.write('/*\n\t' + PARTTOOL_USAGE + '\n\t') f.write('/*\n\t' + PARTTOOL_USAGE + '\n\t')
f.write('--extra-partition-subtypes ') f.write('--extra-partition-subtypes ')
for line_no in subtypes: for line_no in subtypes:
f.write(line_no + ' ') f.write(f'"{line_no}" ')
f.write('\n*/\n\n') f.write('\n*/\n\n')
f.write('#pragma once\n\n') f.write('#pragma once\n\n')
for line_no in subtypes: for line_no in subtypes:

View File

@ -252,6 +252,7 @@ def main():
using the same fallback logic as the IDF bootloader', action='store_true') using the same fallback logic as the IDF bootloader', action='store_true')
partition_selection_parser.add_argument('--partition-subtype', '-s', help='subtype of the partition') partition_selection_parser.add_argument('--partition-subtype', '-s', help='subtype of the partition')
partition_selection_parser.add_argument('--extra-partition-subtypes', help='Extra partition subtype entries', nargs='*')
subparsers = parser.add_subparsers(dest='operation', help='run parttool -h for additional help') subparsers = parser.add_subparsers(dest='operation', help='run parttool -h for additional help')
@ -270,7 +271,6 @@ def main():
print_partition_info_subparser.add_argument('--info', help='type of partition information to get', print_partition_info_subparser.add_argument('--info', help='type of partition information to get',
choices=['name', 'type', 'subtype', 'offset', 'size', 'encrypted'], default=['offset', 'size'], nargs='+') choices=['name', 'type', 'subtype', 'offset', 'size', 'encrypted'], default=['offset', 'size'], nargs='+')
print_partition_info_subparser.add_argument('--part_list', help='Get a list of partitions suitable for a given type', action='store_true') print_partition_info_subparser.add_argument('--part_list', help='Get a list of partitions suitable for a given type', action='store_true')
print_partition_info_subparser.add_argument('--extra-partition-subtypes', help='Extra partition subtype entries', nargs='*')
args = parser.parse_args() args = parser.parse_args()
quiet = args.quiet quiet = args.quiet