partition_table: Extend the get_partition_info command

A manufactory tool needs to retrieve info about partitions.  With a new flag - "--part_list" we can get a list of partitions with the same type/subtype and easily iterate by it.

- name and flag arguments
- added flag "--part_list" to get a list of partitions with the same type/subtype
- save prev behavior of the get_partition_info command (return the only first item)
- added host test
This commit is contained in:
KonstantinKondrashov
2020-10-01 15:10:00 +08:00
parent 48baf1294a
commit 55dc1524ee
4 changed files with 64 additions and 26 deletions

View File

@@ -191,7 +191,7 @@ The component `partition_table` provides a tool :component_file:`parttool.py<par
- reading a partition and saving the contents to a file (read_partition)
- writing the contents of a file to a partition (write_partition)
- erasing a partition (erase_partition)
- retrieving info such as offset and size of a given partition (get_partition_info)
- retrieving info such as name, offset, size and flag ("encrypted") of a given partition (get_partition_info)
The tool can either be imported and used from another Python script or invoked from shell script for users wanting to perform operation programmatically. This is facilitated by the tool's Python API
and command-line interface, respectively.