toos/image-info: use SECTOR-SIZE
Instead of numerical value
This commit is contained in:
parent
0324e02659
commit
36d890d452
1 changed files with 2 additions and 2 deletions
|
|
@ -286,7 +286,7 @@ def read_partition_table(device):
|
|||
ptable = sfdisk["partitiontable"]
|
||||
assert ptable["unit"] == "sectors"
|
||||
is_dos = ptable["label"] == "dos"
|
||||
ssize = ptable.get("sectorsize", 512)
|
||||
ssize = ptable.get("sectorsize", SECTOR_SIZE)
|
||||
|
||||
for i, p in enumerate(ptable["partitions"]):
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ def read_bootloader_type(device) -> str:
|
|||
- 'unknown'
|
||||
"""
|
||||
with open(device, "rb") as f:
|
||||
if b"GRUB" in f.read(512):
|
||||
if b"GRUB" in f.read(SECTOR_SIZE):
|
||||
return "grub"
|
||||
else:
|
||||
return "unknown"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue