diff options
author | Will Dietz <w@wdtz.org> | 2018-01-03 12:25:48 -0600 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2018-01-07 17:50:44 +0200 |
commit | 21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a (patch) | |
tree | f4f191ec2197fde10022e0317e53646a0b067d89 /pkgs/build-support/vm | |
parent | 922bcd0e468739692fdb904741b20f91f90ed714 (diff) | |
download | nixpkgs-21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a.tar nixpkgs-21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a.tar.gz nixpkgs-21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a.tar.bz2 nixpkgs-21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a.tar.lz nixpkgs-21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a.tar.xz nixpkgs-21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a.tar.zst nixpkgs-21f7b2b3f25ed87b038538ac88cfb84bbaf8c58a.zip |
vmTools: omit '-drive ...' entirely instead of using /dev/null
Fixes #33378.
Diffstat (limited to 'pkgs/build-support/vm')
-rw-r--r-- | pkgs/build-support/vm/default.nix | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index e31f513c666..64f4a759e1b 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -208,7 +208,7 @@ rec { -device virtio-rng-pci \ -virtfs local,path=${storeDir},security_model=none,mount_tag=store \ -virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \ - -drive file=$diskImage,if=virtio,cache=unsafe,werror=report \ + ''${diskImage:+-drive file=$diskImage,if=virtio,cache=unsafe,werror=report} \ -kernel ${kernel}/${img} \ -initrd ${initrd}/initrd \ -append "console=ttyS0 panic=1 command=${stage2Init} out=$out mountDisk=$mountDisk loglevel=4" \ @@ -223,8 +223,6 @@ rec { mkdir xchg mv saved-env xchg/ - diskImage=''${diskImage:-/dev/null} - eval "$preVM" if [ "$enableParallelBuilding" = 1 ]; then @@ -240,7 +238,7 @@ rec { # the -K option to preserve the temporary build directory). cat > ./run-vm <<EOF #! ${bash}/bin/sh - diskImage=$diskImage + ''${diskImage:+diskImage=$diskImage} TMPDIR=$TMPDIR cd $TMPDIR ${qemuCommand} |