runInLinuxVM: Don't hardcode x86-specific serial device

This commit is contained in:
Tuomas Tynkkynen 2017-12-06 20:26:16 +02:00 committed by Tuomas Tynkkynen
parent 8e83158f12
commit 8c4f8c51a6

View file

@ -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
'';