summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-06-21 00:22:11 +0200
committerFlorian Klink <flokli@flokli.de>2020-06-21 09:47:02 +0200
commit079de14fd321ada7447a01b363c2b2c9908c67fe (patch)
tree0f0b3038525b2ee5dfc3210ed0459d6115060355
parentcb0db58c18a2809738ef2e49d9f9135502500412 (diff)
downloadnixpkgs-079de14fd321ada7447a01b363c2b2c9908c67fe.tar
nixpkgs-079de14fd321ada7447a01b363c2b2c9908c67fe.tar.gz
nixpkgs-079de14fd321ada7447a01b363c2b2c9908c67fe.tar.bz2
nixpkgs-079de14fd321ada7447a01b363c2b2c9908c67fe.tar.lz
nixpkgs-079de14fd321ada7447a01b363c2b2c9908c67fe.tar.xz
nixpkgs-079de14fd321ada7447a01b363c2b2c9908c67fe.tar.zst
nixpkgs-079de14fd321ada7447a01b363c2b2c9908c67fe.zip
nixos/make-ext4-fs: increase fudge factor from 1.03 to 1.10
Turns out, on smaller images (~800MiB uncompressed sdcard image size),
the current fudge factor is way too small to even get the system to the
phase where it can resize itself.

I first tried with 1.05, but it wasn't enough.
-rw-r--r--nixos/lib/make-ext4-fs.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/lib/make-ext4-fs.nix b/nixos/lib/make-ext4-fs.nix
index 627ac324cf5..516fe3fc673 100644
--- a/nixos/lib/make-ext4-fs.nix
+++ b/nixos/lib/make-ext4-fs.nix
@@ -43,7 +43,7 @@ pkgs.stdenv.mkDerivation {
       # Make a crude approximation of the size of the target image.
       # If the script starts failing, increase the fudge factors here.
       numInodes=$(find $storePaths ./files | wc -l)
-      numDataBlocks=$(du -s -c -B 4096 --apparent-size $storePaths ./files | tail -1 | awk '{ print int($1 * 1.03) }')
+      numDataBlocks=$(du -s -c -B 4096 --apparent-size $storePaths ./files | tail -1 | awk '{ print int($1 * 1.10) }')
       bytes=$((2 * 4096 * $numInodes + 4096 * $numDataBlocks))
       echo "Creating an EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks)"