From 36d890d4524250cbf6a5c45586cb85beac25b379 Mon Sep 17 00:00:00 2001 From: Thomas Lavocat Date: Mon, 6 Feb 2023 18:14:02 +0100 Subject: [PATCH] toos/image-info: use SECTOR-SIZE Instead of numerical value --- tools/image-info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/image-info b/tools/image-info index cd29d5419..85ec28d5d 100755 --- a/tools/image-info +++ b/tools/image-info @@ -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"