summary refs log tree commit diff
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-12-06 20:26:16 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2018-01-30 16:57:27 +0200
commit8c4f8c51a640e169484e4513b62d50844b2ed779 (patch)
treeb394a3880d65c739561aa66de94b47188a83c654
parent8e83158f124f6c8d5583a32102f281bde10769cd (diff)
downloadnixlib-8c4f8c51a640e169484e4513b62d50844b2ed779.tar
nixlib-8c4f8c51a640e169484e4513b62d50844b2ed779.tar.gz
nixlib-8c4f8c51a640e169484e4513b62d50844b2ed779.tar.bz2
nixlib-8c4f8c51a640e169484e4513b62d50844b2ed779.tar.lz
nixlib-8c4f8c51a640e169484e4513b62d50844b2ed779.tar.xz
nixlib-8c4f8c51a640e169484e4513b62d50844b2ed779.tar.zst
nixlib-8c4f8c51a640e169484e4513b62d50844b2ed779.zip
runInLinuxVM: Don't hardcode x86-specific serial device
-rw-r--r--pkgs/build-support/vm/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index aa340fcd8e26..cf6e7cc1fe4e 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -8,6 +8,7 @@
 }:
 
 with pkgs;
+with import ../../../nixos/lib/qemu-flags.nix { inherit pkgs; };
 
 rec {
 
@@ -197,7 +198,7 @@ rec {
       export PATH=/bin:/usr/bin:${coreutils}/bin
       echo "Starting interactive shell..."
       echo "(To run the original builder: \$origBuilder \$origArgs)"
-      exec ${busybox}/bin/setsid ${bashInteractive}/bin/bash < /dev/ttyS0 &> /dev/ttyS0
+      exec ${busybox}/bin/setsid ${bashInteractive}/bin/bash < /dev/${qemuSerialDevice} &> /dev/${qemuSerialDevice}
     fi
   '';
 
@@ -212,7 +213,7 @@ rec {
       ''${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" \
+      -append "console=${qemuSerialDevice} panic=1 command=${stage2Init} out=$out mountDisk=$mountDisk loglevel=4" \
       $QEMU_OPTS
   '';