From: Liam McBirnie Date: Sun, 28 Feb 2021 20:43:27 +0000 (+0100) Subject: Fix generated root partition being too small for encrypted images. X-Git-Tag: v10~56^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F663%2Fhead;p=thirdparty%2Fmkosi.git 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. --- 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)}...")