Skip to content

Commit 1d72474

Browse files
committedJul 29, 2017
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.
1 parent 4d66de8 commit 1d72474

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎nixos/lib/make-ext4-fs.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pkgs.stdenv.mkDerivation {
3333
echo "Creating an EXT4 image of $bytes bytes (numInodes=$numInodes, numDataBlocks=$numDataBlocks)"
3434
3535
truncate -s $bytes $out
36-
faketime "1970-01-01 00:00:00" mkfs.ext4 -L ${volumeLabel} -U 44444444-4444-4444-8888-888888888888 $out
36+
faketime -f "1970-01-01 00:00:01" mkfs.ext4 -L ${volumeLabel} -U 44444444-4444-4444-8888-888888888888 $out
3737
3838
# Populate the image contents by piping a bunch of commands to the `debugfs` tool from e2fsprogs.
3939
# For example, to copy /nix/store/abcd...efg-coreutils-8.23/bin/sleep:
@@ -76,7 +76,7 @@ pkgs.stdenv.mkDerivation {
7676
7777
echo sif $file gid 30000 # chgrp to nixbld
7878
done
79-
) | faketime "1970-01-01 00:00:00" debugfs -w $out -f /dev/stdin > errorlog 2>&1
79+
) | faketime -f "1970-01-01 00:00:01" debugfs -w $out -f /dev/stdin > errorlog 2>&1
8080
8181
# The debugfs tool doesn't terminate on error nor exit with a non-zero status. Check manually.
8282
if egrep -q 'Could not allocate|File not found' errorlog; then

0 commit comments

Comments
 (0)
Please sign in to comment.