From 5244b703e670a3363d01772bb8f13daa507d7f3a Mon Sep 17 00:00:00 2001 From: SashegDev Date: Fri, 11 Sep 2026 08:16:55 +0000 Subject: [PATCH] mkimage: fix with-block indent --- tools/mkimage.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/mkimage.py b/tools/mkimage.py index 825e691..92a3626 100644 --- a/tools/mkimage.py +++ b/tools/mkimage.py @@ -113,19 +113,19 @@ def main(): f.seek(uoff + (USER_SECTORS - 1) * SECTOR) f.write(gpt_header(128, 1, disk, crc_e, cur=USER_SECTORS - 1)) - if user_src: - print(f"[mkimage] copying User content (keeps GPT in place)...") - with open(user_src, "rb") as u: - # copy in 128M chunks, skipping GPT areas (LBA 0..33, backup) - u.seek(34 * SECTOR) - f.seek(uoff + 34 * SECTOR) - left = (USER_SECTORS - 33) * SECTOR - 34 * SECTOR - while left > 0: - d = u.read(min(left, 134217728)) - if not d: - break - f.write(d) - left -= len(d) + if user_src: + print(f"[mkimage] copying User content (keeps GPT in place)...") + with open(user_src, "rb") as u: + # copy in 128M chunks, skipping GPT areas (LBA 0..33, backup) + u.seek(34 * SECTOR) + f.seek(uoff + 34 * SECTOR) + left = (USER_SECTORS - 33) * SECTOR - 34 * SECTOR + while left > 0: + d = u.read(min(left, 134217728)) + if not d: + break + f.write(d) + left -= len(d) print(f"[mkimage] OK: {len(PARTS)} partitions, primary+backup GPT, CRC ok")