diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-05-11 18:51:08 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-05-11 18:51:08 +0000 |
commit | 3c202eab9a5be50021b90b41a09288cab5f2aa03 (patch) | |
tree | 35e67a39d3b6bf130ce7587a795a6346126c70cf /pkgs/os-specific/linux/spectrum | |
parent | 80cd108ab66b06e9c2636cfc2a7863b8996ff1b0 (diff) | |
download | nixpkgs-3c202eab9a5be50021b90b41a09288cab5f2aa03.tar nixpkgs-3c202eab9a5be50021b90b41a09288cab5f2aa03.tar.gz nixpkgs-3c202eab9a5be50021b90b41a09288cab5f2aa03.tar.bz2 nixpkgs-3c202eab9a5be50021b90b41a09288cab5f2aa03.tar.lz nixpkgs-3c202eab9a5be50021b90b41a09288cab5f2aa03.tar.xz nixpkgs-3c202eab9a5be50021b90b41a09288cab5f2aa03.tar.zst nixpkgs-3c202eab9a5be50021b90b41a09288cab5f2aa03.zip |
spectrumPackages.spectrum-vm: custom crosvm opts
This will be especially useful for testing crosvm cargo builds, which only work at the moment with --disable-sandbox. Testing these builds before was extremely annoying, but it can be done relatively easily as follows: cargo build spectrum-vm -C target/debug/crosvm -- --disable-sandbox
Diffstat (limited to 'pkgs/os-specific/linux/spectrum')
-rwxr-xr-x | pkgs/os-specific/linux/spectrum/spectrum-vm/spectrum-vm.in | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/pkgs/os-specific/linux/spectrum/spectrum-vm/spectrum-vm.in b/pkgs/os-specific/linux/spectrum/spectrum-vm/spectrum-vm.in index 7c653da12f4..daacfcd22ac 100755 --- a/pkgs/os-specific/linux/spectrum/spectrum-vm/spectrum-vm.in +++ b/pkgs/os-specific/linux/spectrum/spectrum-vm/spectrum-vm.in @@ -3,12 +3,13 @@ set -ue ex_usage() { cat <<EOF -Usage: $(basename "$0") [OPTION]... +Usage: $(basename "$0") [OPTION]... [-- CROSVM_OPTIONS] -c COMMAND shell command to run inside VM -C, --crosvm PATH path to custom crosvm executable -k, --kernel PATH path to custom kernel image -f, --rootfs PATH path to custom root file system image + -- CROSVM_OPTIONS extra arguments to pass to crosvm EOF exit "$1" } @@ -54,22 +55,19 @@ do esac done -if [ "$#" -ne 0 ]; then - ex_usage 1 >&2 -fi - set +e if [ -n "$XDG_RUNTIME_DIR" ] then - set -- -s "$XDG_RUNTIME_DIR" + set -- -s "$XDG_RUNTIME_DIR" "$@" if [ -n "$WAYLAND_DISPLAY" ] - then set -- "$@" --wayland-sock "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" + then set -- --wayland-sock "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" "$@" fi fi set -e -exec "$crosvm" run "$@" \ +exec "$crosvm" run \ -p init=/sbin/init \ -p "spectrumcmd=$(printf %s "$command" | base64)" \ --root "$rootfs" \ + "$@" \ "$kernel" |