From e9b6c145fa37c91663ad1d03cb9d05c2f5e76fbb Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Thu, 21 Nov 2019 20:41:55 -0500 Subject: [PATCH] imageBuilder.makeMBR: Fixes bug with gap The size wasn't fixed after aligning the result, this dividing the sizes by as the alignment. --- lib/image-builder/makeMBR.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/image-builder/makeMBR.nix b/lib/image-builder/makeMBR.nix index ebd77f121..3abd5f166 100644 --- a/lib/image-builder/makeMBR.nix +++ b/lib/image-builder/makeMBR.nix @@ -67,6 +67,7 @@ stdenvNoCC.mkDerivation rec { start=$totalSize size=${toString partition.length} size=$(( $(if (($size % ${alignment})); then echo 1; else echo 0; fi ) + size / ${alignment} )) + size=$(( size * ${alignment} )) totalSize=$(( totalSize + size )) echo "Gap: start $start | size $size | totalSize $totalSize" '';