From 6010a021c6558e0d633fc55807b176bb68d2b478 Mon Sep 17 00:00:00 2001 From: Liam McBirnie Date: Sun, 28 Feb 2021 21:43:27 +0100 Subject: [PATCH] Fix generated root partition being too small for encrypted images. Building encrypted minimized or squashfs images was failing at the 'dd' command in 'insert_partition' with the error 'No space left on device'. Increasing the luks overhead from 2MB to 16MB allows enough space. 16MB was found to be the smallest overhead which wouldn't fail. --- mkosi/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi/__init__.py b/mkosi/__init__.py index c2099847c..e694cbbe1 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3665,7 +3665,7 @@ def insert_partition( last_partition_sector = GPT_HEADER_SIZE blob_size = roundup512(os.stat(blob.name).st_size) - luks_extra = 2 * 1024 * 1024 if args.encrypt == "all" else 0 + luks_extra = 16 * 1024 * 1024 if args.encrypt == "all" else 0 new_size = last_partition_sector + blob_size + luks_extra + GPT_FOOTER_SIZE MkosiPrinter.print_step(f"Resizing disk image to {format_bytes(new_size)}...") -- 2.47.2