summary refs log tree commit diff
path: root/nixos/lib/make-ext4-fs.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-07-29 22:03:43 +0300
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-07-29 22:03:43 +0300
commit1d72474df7fa361d72a04d2a3ec4589b286ab6f2 (patch)
treebb245ebc16b28b2997f41d0b2f8ec3495cabb5c0 /nixos/lib/make-ext4-fs.nix
parent4d66de88fffada1f4970e5173be78c1ef30a8798 (diff)
downloadnixlib-1d72474df7fa361d72a04d2a3ec4589b286ab6f2.tar
nixlib-1d72474df7fa361d72a04d2a3ec4589b286ab6f2.tar.gz
nixlib-1d72474df7fa361d72a04d2a3ec4589b286ab6f2.tar.bz2
nixlib-1d72474df7fa361d72a04d2a3ec4589b286ab6f2.tar.lz
nixlib-1d72474df7fa361d72a04d2a3ec4589b286ab6f2.tar.xz
nixlib-1d72474df7fa361d72a04d2a3ec4589b286ab6f2.tar.zst
nixlib-1d72474df7fa361d72a04d2a3ec4589b286ab6f2.zip
make-ext4-fs: Fix modification timestamps in image
Use '-f' to make timestamp calls to always return the same time. Also
Nix uses the timestamp of '1' instead of epoch directly.
Diffstat (limited to 'nixos/lib/make-ext4-fs.nix')
-rw-r--r--nixos/lib/make-ext4-fs.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/lib/make-ext4-fs.nix b/nixos/lib/make-ext4-fs.nix
index 23839ea487db..f06649e1991a 100644
--- a/nixos/lib/make-ext4-fs.nix
+++ b/nixos/lib/make-ext4-fs.nix
@@ -33,7 +33,7 @@ pkgs.stdenv.mkDerivation {
       echo "Creating an EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks)"
 
       truncate -s $bytes $out
-      faketime "1970-01-01 00:00:00" mkfs.ext4 -L ${volumeLabel} -U 44444444-4444-4444-8888-888888888888 $out
+      faketime -f "1970-01-01 00:00:01" mkfs.ext4 -L ${volumeLabel} -U 44444444-4444-4444-8888-888888888888 $out
 
       # Populate the image contents by piping a bunch of commands to the `debugfs` tool from e2fsprogs.
       # For example, to copy /nix/store/abcd...efg-coreutils-8.23/bin/sleep:
@@ -76,7 +76,7 @@ pkgs.stdenv.mkDerivation {
 
           echo sif $file gid 30000 # chgrp to nixbld
         done
-      ) | faketime "1970-01-01 00:00:00" debugfs -w $out -f /dev/stdin > errorlog 2>&1
+      ) | faketime -f "1970-01-01 00:00:01" debugfs -w $out -f /dev/stdin > errorlog 2>&1
 
       # The debugfs tool doesn't terminate on error nor exit with a non-zero status. Check manually.
       if egrep -q 'Could not allocate|File not found' errorlog; then