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).
This commit is contained in:
Alyssa Ross 2019-12-17 17:49:39 +00:00
parent 0c62e73b37
commit c76deaef9c
3 changed files with 48 additions and 43 deletions

View File

@ -1,9 +1,9 @@
diff --git a/src/main.rs b/src/main.rs diff --git a/src/crosvm.rs b/src/crosvm.rs
index 81f20a7..481ebd7 100644 index b7055df..5989c87 100644
--- a/src/main.rs --- a/src/crosvm.rs
+++ b/src/main.rs +++ b/src/crosvm.rs
@@ -158,7 +158,9 @@ impl Default for Config { @@ -141,7 +141,9 @@ impl Default for Config {
wayland_dmabuf: false, x_display: None,
shared_dirs: Vec::new(), shared_dirs: Vec::new(),
sandbox: !cfg!(feature = "default-no-sandbox"), sandbox: !cfg!(feature = "default-no-sandbox"),
- seccomp_policy_dir: PathBuf::from(SECCOMP_POLICY_DIR), - seccomp_policy_dir: PathBuf::from(SECCOMP_POLICY_DIR),

View File

@ -11,32 +11,15 @@ let
else if isx86_64 then "x86_64" else if isx86_64 then "x86_64"
else throw "no seccomp policy files available for host platform"; 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 crosvmSrc = fetchgit {
delink = src: runCommand "${src.name}-delinked" { inherit (upstreamInfo.components."chromiumos/platform/crosvm")
preferLocalBuild = true; url rev sha256 fetchSubmodules;
allowSubstitutes = false; };
} ''
cp -prL --reflink=auto ${src} $out
'';
# used to place subtrees into the location they have in the Chromium monorepo adhdSrc = fetchgit {
move = src: target: runCommand "moved-${src.name}" { inherit (upstreamInfo.components."chromiumos/third_party/adhd")
preferLocalBuild = true; url rev sha256 fetchSubmodules;
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;
});
in in
@ -44,15 +27,33 @@ in
pname = "crosvm"; pname = "crosvm";
inherit (upstreamInfo) version; 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 = [ patches = [
./default-seccomp-policy-dir.patch ./default-seccomp-policy-dir.diff
]; ];
cargoSha256 = "16cfp79c13ng5jjcrvz00h3cg7cc9ywhjiq02vsm757knn9jgr1v"; cargoSha256 = "1d7y07wkliy5qnlyx5zj6ni39avhs3s48sqgvwxm5g5zrahg2a85";
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
@ -72,7 +73,11 @@ in
cp seccomp/${arch}/* $out/share/policy/ cp seccomp/${arch}/* $out/share/policy/
''; '';
passthru.updateScript = ./update.py; passthru = {
inherit adhdSrc;
src = crosvmSrc;
updateScript = ./update.py;
};
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A secure virtual machine monitor for KVM"; description = "A secure virtual machine monitor for KVM";

View File

@ -1,18 +1,18 @@
{ {
"version": "77.12371.0.0-rc1", "version": "79.12607.0.0-rc4",
"components": { "components": {
"chromiumos/platform/crosvm": { "chromiumos/platform/crosvm": {
"url": "https://chromium.googlesource.com/chromiumos/platform/crosvm", "url": "https://chromium.googlesource.com/chromiumos/platform/crosvm",
"rev": "f5285c647acacb4f25ef8cf9334254b976e71686", "rev": "cfb7db44eb9e5a0bca9a22bfb985252ef74ab251",
"date": "2019-07-25T22:15:48+00:00", "date": "2019-10-17T23:22:08+00:00",
"sha256": "1ccjd540xmpad082w9ri13q78wkg95xxmq38b8ybcrj4f7lsxm6w", "sha256": "0gm1ggyzh9qfizm36jmh71c3anygxj1840cm94h71kzg9kiw0330",
"fetchSubmodules": false "fetchSubmodules": false
}, },
"chromiumos/third_party/adhd": { "chromiumos/third_party/adhd": {
"url": "https://chromium.googlesource.com/chromiumos/third_party/adhd", "url": "https://chromium.googlesource.com/chromiumos/third_party/adhd",
"rev": "a1c0d93d991daffb042b979ac807bbe9c1f9a3ee", "rev": "a8df1c52bde3bfd2aebc1d7adcd6f195eb212cb1",
"date": "2019-07-25T20:38:50-07:00", "date": "2019-10-17T18:53:18+00:00",
"sha256": "11bijqd876adarq96syywn6znfbiflqssgb2j4w032iw2vfnnsyy", "sha256": "1hyvnvwr5ka9zw4h7hhl6fpsfl2acp3zy4wr5qrw8s1cn8ljr9vy",
"fetchSubmodules": false "fetchSubmodules": false
} }
} }