From c76deaef9caa3156a25b2df2a036b4994f9ed7a7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 17 Dec 2019 17:49:39 +0000 Subject: [PATCH] crosvm: 77.12371.0.0-rc1 -> 79.12607.0.0-rc4 Replaced src munging with a custom unpackPhase because the previous approach couldn't handle a newly introduced path with a space, and this is cleaner anyway (but was impossible at the time due to unpackPhase not being forwarded to fetchcargo). --- ....patch => default-seccomp-policy-dir.diff} | 12 ++-- .../virtualization/crosvm/default.nix | 65 ++++++++++--------- .../virtualization/crosvm/upstream-info.json | 14 ++-- 3 files changed, 48 insertions(+), 43 deletions(-) rename pkgs/applications/virtualization/crosvm/{default-seccomp-policy-dir.patch => default-seccomp-policy-dir.diff} (69%) diff --git a/pkgs/applications/virtualization/crosvm/default-seccomp-policy-dir.patch b/pkgs/applications/virtualization/crosvm/default-seccomp-policy-dir.diff similarity index 69% rename from pkgs/applications/virtualization/crosvm/default-seccomp-policy-dir.patch rename to pkgs/applications/virtualization/crosvm/default-seccomp-policy-dir.diff index 46b091b3a353..f1aa50ee102c 100644 --- a/pkgs/applications/virtualization/crosvm/default-seccomp-policy-dir.patch +++ b/pkgs/applications/virtualization/crosvm/default-seccomp-policy-dir.diff @@ -1,9 +1,9 @@ -diff --git a/src/main.rs b/src/main.rs -index 81f20a7..481ebd7 100644 ---- a/src/main.rs -+++ b/src/main.rs -@@ -158,7 +158,9 @@ impl Default for Config { - wayland_dmabuf: false, +diff --git a/src/crosvm.rs b/src/crosvm.rs +index b7055df..5989c87 100644 +--- a/src/crosvm.rs ++++ b/src/crosvm.rs +@@ -141,7 +141,9 @@ impl Default for Config { + x_display: None, shared_dirs: Vec::new(), sandbox: !cfg!(feature = "default-no-sandbox"), - seccomp_policy_dir: PathBuf::from(SECCOMP_POLICY_DIR), diff --git a/pkgs/applications/virtualization/crosvm/default.nix b/pkgs/applications/virtualization/crosvm/default.nix index 5c10614e8569..5035b65f9818 100644 --- a/pkgs/applications/virtualization/crosvm/default.nix +++ b/pkgs/applications/virtualization/crosvm/default.nix @@ -11,32 +11,15 @@ let else if isx86_64 then "x86_64" else throw "no seccomp policy files available for host platform"; - # used to turn symlinks into real files because write permissions are necessary for the vendoring process - delink = src: runCommand "${src.name}-delinked" { - preferLocalBuild = true; - allowSubstitutes = false; - } '' - cp -prL --reflink=auto ${src} $out - ''; + crosvmSrc = fetchgit { + inherit (upstreamInfo.components."chromiumos/platform/crosvm") + url rev sha256 fetchSubmodules; + }; - # used to place subtrees into the location they have in the Chromium monorepo - move = src: target: runCommand "moved-${src.name}" { - preferLocalBuild = true; - allowSubstitutes = false; - } '' - mkdir -p $(dirname $out/${target}) - ln -s ${src} $out/${target} - ''; - - # used to check out subtrees from the Chromium monorepo - chromiumSource = name: subtrees: delink (symlinkJoin { - inherit name; - paths = stdenv.lib.mapAttrsToList ( - location: { url, rev, sha256, fetchSubmodules, ... }: - move (fetchgit { - inherit url rev sha256 fetchSubmodules; - }) location) subtrees; - }); + adhdSrc = fetchgit { + inherit (upstreamInfo.components."chromiumos/third_party/adhd") + url rev sha256 fetchSubmodules; + }; in @@ -44,15 +27,33 @@ in pname = "crosvm"; inherit (upstreamInfo) version; - src = chromiumSource "${pname}-sources" upstreamInfo.components; + unpackPhase = '' + runHook preUnpack - sourceRoot = "${src.name}/chromiumos/platform/crosvm"; + mkdir -p chromiumos/platform chromiumos/third_party + + pushd chromiumos/platform + unpackFile ${crosvmSrc} + mv ${crosvmSrc.name} crosvm + popd + + pushd chromiumos/third_party + unpackFile ${adhdSrc} + mv ${adhdSrc.name} adhd + popd + + chmod -R u+w -- "$sourceRoot" + + runHook postUnpack + ''; + + sourceRoot = "chromiumos/platform/crosvm"; patches = [ - ./default-seccomp-policy-dir.patch + ./default-seccomp-policy-dir.diff ]; - cargoSha256 = "16cfp79c13ng5jjcrvz00h3cg7cc9ywhjiq02vsm757knn9jgr1v"; + cargoSha256 = "1d7y07wkliy5qnlyx5zj6ni39avhs3s48sqgvwxm5g5zrahg2a85"; nativeBuildInputs = [ pkgconfig ]; @@ -72,7 +73,11 @@ in cp seccomp/${arch}/* $out/share/policy/ ''; - passthru.updateScript = ./update.py; + passthru = { + inherit adhdSrc; + src = crosvmSrc; + updateScript = ./update.py; + }; meta = with stdenv.lib; { description = "A secure virtual machine monitor for KVM"; diff --git a/pkgs/applications/virtualization/crosvm/upstream-info.json b/pkgs/applications/virtualization/crosvm/upstream-info.json index 01921f9460a0..690eca38bffb 100644 --- a/pkgs/applications/virtualization/crosvm/upstream-info.json +++ b/pkgs/applications/virtualization/crosvm/upstream-info.json @@ -1,18 +1,18 @@ { - "version": "77.12371.0.0-rc1", + "version": "79.12607.0.0-rc4", "components": { "chromiumos/platform/crosvm": { "url": "https://chromium.googlesource.com/chromiumos/platform/crosvm", - "rev": "f5285c647acacb4f25ef8cf9334254b976e71686", - "date": "2019-07-25T22:15:48+00:00", - "sha256": "1ccjd540xmpad082w9ri13q78wkg95xxmq38b8ybcrj4f7lsxm6w", + "rev": "cfb7db44eb9e5a0bca9a22bfb985252ef74ab251", + "date": "2019-10-17T23:22:08+00:00", + "sha256": "0gm1ggyzh9qfizm36jmh71c3anygxj1840cm94h71kzg9kiw0330", "fetchSubmodules": false }, "chromiumos/third_party/adhd": { "url": "https://chromium.googlesource.com/chromiumos/third_party/adhd", - "rev": "a1c0d93d991daffb042b979ac807bbe9c1f9a3ee", - "date": "2019-07-25T20:38:50-07:00", - "sha256": "11bijqd876adarq96syywn6znfbiflqssgb2j4w032iw2vfnnsyy", + "rev": "a8df1c52bde3bfd2aebc1d7adcd6f195eb212cb1", + "date": "2019-10-17T18:53:18+00:00", + "sha256": "1hyvnvwr5ka9zw4h7hhl6fpsfl2acp3zy4wr5qrw8s1cn8ljr9vy", "fetchSubmodules": false } }