Merge pull request #31537 from orivej/lkl

lkl: 2017-10-18 -> 2017-11-10, make-disk-image: do not fake time for cptofs

authored by Orivej Desh and committed by GitHub f7bb8d2d ab1859e0

+11 -18
+8 -15
nixos/lib/make-disk-image.nix
··· 33 34 , name ? "nixos-disk-image" 35 36 - , format ? "raw" 37 }: 38 39 with lib; ··· 45 raw = "img"; 46 }; 47 48 - nixpkgs = lib.cleanSource pkgs.path; 49 50 channelSources = pkgs.runCommand "nixos-${config.system.nixosVersion}" {} '' 51 mkdir -p $out ··· 64 ${channelSources} 65 ''; 66 67 - prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot libfaketime config.system.build.nixos-prepare-root ] ++ stdenv.initialPath; 68 69 # I'm preserving the line below because I'm going to search for it across nixpkgs to consolidate 70 # image building logic. The comment right below this now appears in 4 different places in nixpkgs :) ··· 73 targets = map (x: x.target) contents; 74 75 prepareImage = '' 76 - export PATH=${pkgs.lib.makeSearchPathOutput "bin" "bin" prepareImageInputs} 77 78 mkdir $out 79 diskImage=nixos.raw ··· 86 offset=0 87 ''} 88 89 - faketime -f "1970-01-01 00:00:01" mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage 90 - 91 root="$PWD/root" 92 mkdir -p $root 93 ··· 124 fakeroot nixos-prepare-root $root ${channelSources} ${config.system.build.toplevel} closure 125 126 echo "copying staging root to image..." 127 - # If we don't faketime, we can end up with timestamps other than 1 on the nix store, which 128 - # will confuse Nix in some situations (e.g., breaking image builds in the target image) 129 - # N.B: I use 0 here, which results in timestamp = 1 in the image. It's weird but see 130 - # https://github.com/lkl/linux/issues/393. Also, running under faketime makes `cptofs` super 131 - # noisy and it prints out that it can't find a bunch of files, and then works anyway. We'll 132 - # shut it up someday but trying to do a stderr filter through grep is running into some nasty 133 - # bug in some eval nonsense we have in runInLinuxVM and I'm sick of trying to fix it. 134 - faketime -f "1970-01-01 00:00:00" \ 135 - cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* / 136 ''; 137 in pkgs.vmTools.runInLinuxVM ( 138 pkgs.runCommand name
··· 33 34 , name ? "nixos-disk-image" 35 36 + , # Disk image format, one of qcow2, vpc, raw. 37 + format ? "raw" 38 }: 39 40 with lib; ··· 46 raw = "img"; 47 }; 48 49 + nixpkgs = cleanSource pkgs.path; 50 51 channelSources = pkgs.runCommand "nixos-${config.system.nixosVersion}" {} '' 52 mkdir -p $out ··· 65 ${channelSources} 66 ''; 67 68 + prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot config.system.build.nixos-prepare-root ] ++ stdenv.initialPath; 69 70 # I'm preserving the line below because I'm going to search for it across nixpkgs to consolidate 71 # image building logic. The comment right below this now appears in 4 different places in nixpkgs :) ··· 74 targets = map (x: x.target) contents; 75 76 prepareImage = '' 77 + export PATH=${makeSearchPathOutput "bin" "bin" prepareImageInputs} 78 79 mkdir $out 80 diskImage=nixos.raw ··· 87 offset=0 88 ''} 89 90 + mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage 91 + 92 root="$PWD/root" 93 mkdir -p $root 94 ··· 125 fakeroot nixos-prepare-root $root ${channelSources} ${config.system.build.toplevel} closure 126 127 echo "copying staging root to image..." 128 + cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* / 129 ''; 130 in pkgs.vmTools.runInLinuxVM ( 131 pkgs.runCommand name
+3 -3
pkgs/applications/virtualization/lkl/default.nix
··· 1 { stdenv, fetchFromGitHub, bc, python, fuse, libarchive }: 2 3 stdenv.mkDerivation rec { 4 - name = "lkl-2017-10-18"; 5 - rev = "bfb315c4612c38427e3239d0a427a125d9ba0ede"; 6 7 outputs = [ "dev" "lib" "out" ]; 8 ··· 14 inherit rev; 15 owner = "lkl"; 16 repo = "linux"; 17 - sha256 = "172ccn2gsybnji7giiqq63bvp9nsw8kri88pjlvinwpwsv7x81aa"; 18 }; 19 20 # Fix a /usr/bin/env reference in here that breaks sandboxed builds
··· 1 { stdenv, fetchFromGitHub, bc, python, fuse, libarchive }: 2 3 stdenv.mkDerivation rec { 4 + name = "lkl-2017-11-10"; 5 + rev = "52a6a643c7d1dd3031c0cbec75e1ac7a999f3d57"; 6 7 outputs = [ "dev" "lib" "out" ]; 8 ··· 14 inherit rev; 15 owner = "lkl"; 16 repo = "linux"; 17 + sha256 = "1i5ywrfxqpykjjalwh9g4rwd4s186cqk3j806d327a67xb2ivxnp"; 18 }; 19 20 # Fix a /usr/bin/env reference in here that breaks sandboxed builds