image-info: read sector size, if available
Use the sector size reported by 'sfdisk', if available, otherwise default to the standard value of '512' (as currently assumed).
This commit is contained in:
parent
5bca8bcacd
commit
aa03f1617a
1 changed files with 3 additions and 2 deletions
|
|
@ -171,6 +171,7 @@ def read_partition_table(device):
|
|||
ptable = sfdisk["partitiontable"]
|
||||
assert ptable["unit"] == "sectors"
|
||||
is_dos = ptable["label"] == "dos"
|
||||
ssize = ptable.get("sectorsize", 512)
|
||||
|
||||
for i, p in enumerate(ptable["partitions"]):
|
||||
|
||||
|
|
@ -187,8 +188,8 @@ def read_partition_table(device):
|
|||
partitions.append({
|
||||
"bootable": p.get("bootable", False),
|
||||
"type": p["type"],
|
||||
"start": p["start"] * 512,
|
||||
"size": p["size"] * 512,
|
||||
"start": p["start"] * ssize,
|
||||
"size": p["size"] * ssize,
|
||||
"partuuid": partuuid
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue