From e783ec66325b254d92ec2733325b53b64eb6e9db Mon Sep 17 00:00:00 2001 From: Syboxez Blank <@Syboxez:matrix.org> Date: Thu, 14 Dec 2023 21:00:06 -0600 Subject: [PATCH] image/image.py: Fix off-by-one error when creating boot partition in full image --- image/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image/image.py b/image/image.py index 029954b..123ef6a 100644 --- a/image/image.py +++ b/image/image.py @@ -356,7 +356,7 @@ def create_img_file(image_path: str, size_str: str): def partition_device(device: str, sector_size: int, boot_partition_size_mb: int = IMG_DEFAULT_SIZE_BOOT_MB): initial_offset = 1048576 // sector_size # 2048 for 512, 256 for 4096 - boot_partition_size: int = align_bytes(boot_partition_size_mb * 1024 * 1024, 4096) + boot_partition_size: int = align_bytes((boot_partition_size_mb + 1) * 1024 * 1024, 4096) create_partition_table = ['mklabel', 'msdos'] create_boot_partition = ['mkpart', 'primary', 'ext2', f'{initial_offset}s', f'{boot_partition_size}b'] create_root_partition = ['mkpart', 'primary', f'{bytes_to_sectors(boot_partition_size, sector_size) + initial_offset}s', '100%']