mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 13:15:44 -05:00
image/image.py: Fix off-by-one error when creating boot partition in full image
This commit is contained in:
parent
4c5609423e
commit
e783ec6632
1 changed files with 1 additions and 1 deletions
|
@ -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%']
|
||||
|
|
Loading…
Add table
Reference in a new issue