]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix generated root partition being too small for encrypted images. 663/head
authorLiam McBirnie <mcbirnie.l@gmail.com>
Sun, 28 Feb 2021 20:43:27 +0000 (21:43 +0100)
committerLiam McBirnie <mcbirnie.l@gmail.com>
Wed, 3 Mar 2021 20:40:01 +0000 (21:40 +0100)
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

index c2099847c721a47c6140f1fe9c6c018e1ec9b98a..e694cbbe1f0cbb51c31b40e136acf77f44415bb0 100644 (file)
@@ -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)}...")