diff options
author | Orivej Desh <orivej@gmx.fr> | 2017-11-11 20:50:00 +0000 |
---|---|---|
committer | Orivej Desh <orivej@gmx.fr> | 2017-11-11 20:57:14 +0000 |
commit | a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc (patch) | |
tree | 334110138950503c0c8a1e523d742ec92a15e1e8 /nixos | |
parent | b8cc69b31e9070e4bf33c18e5514eca6ab77de07 (diff) | |
download | nixlib-a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc.tar nixlib-a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc.tar.gz nixlib-a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc.tar.bz2 nixlib-a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc.tar.lz nixlib-a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc.tar.xz nixlib-a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc.tar.zst nixlib-a84ce72fdc0ca45f7e8de93ad946091ad7f2afbc.zip |
make-disk-image: do not use faketime
Since https://github.com/lkl/linux/pull/394 cptofs preserves the source time, which is 1970-01-01T00:00:01Z for /nix/store and recent for other files. This reverts commit f5b3f2c5a7f2b51e80ac32fb47fd1d7d3e475ad1.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/make-disk-image.nix | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index f1cbd0b9c08d..9d1327d9c15a 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -65,7 +65,7 @@ let ${channelSources} ''; - prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot libfaketime config.system.build.nixos-prepare-root ] ++ stdenv.initialPath; + prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot config.system.build.nixos-prepare-root ] ++ stdenv.initialPath; # I'm preserving the line below because I'm going to search for it across nixpkgs to consolidate # image building logic. The comment right below this now appears in 4 different places in nixpkgs :) @@ -87,7 +87,7 @@ let offset=0 ''} - faketime -f "1970-01-01 00:00:01" mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage + mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage root="$PWD/root" mkdir -p $root @@ -125,15 +125,7 @@ let fakeroot nixos-prepare-root $root ${channelSources} ${config.system.build.toplevel} closure echo "copying staging root to image..." - # If we don't faketime, we can end up with timestamps other than 1 on the nix store, which - # will confuse Nix in some situations (e.g., breaking image builds in the target image) - # N.B: I use 0 here, which results in timestamp = 1 in the image. It's weird but see - # https://github.com/lkl/linux/issues/393. Also, running under faketime makes `cptofs` super - # noisy and it prints out that it can't find a bunch of files, and then works anyway. We'll - # shut it up someday but trying to do a stderr filter through grep is running into some nasty - # bug in some eval nonsense we have in runInLinuxVM and I'm sick of trying to fix it. - faketime -f "1970-01-01 00:00:00" \ - cptofs ${optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* / + cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* / ''; in pkgs.vmTools.runInLinuxVM ( pkgs.runCommand name |