image-info: read format info before image opening
Read the image information before opening the image. This prepares for a change where we will use information about the image to convert it to raw instead of using nbd.
This commit is contained in:
parent
44f0ba368f
commit
b7a43b5812
1 changed files with 3 additions and 2 deletions
|
|
@ -288,9 +288,10 @@ def find_esp(partitions):
|
|||
def analyse_image(image):
|
||||
subprocess.run(["modprobe", "nbd"], check=True)
|
||||
|
||||
report = {}
|
||||
imgfmt = read_image_format(image)
|
||||
report = {"image-format": imgfmt}
|
||||
|
||||
with nbd_connect(image) as device:
|
||||
report["image-format"] = read_image_format(image)
|
||||
report["bootloader"] = read_bootloader_type(device)
|
||||
report["partition-table"], report["partition-table-id"], report["partitions"] = read_partition_table(device)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue