runInLinuxVM: Don't hardcode x86-specific serial device

authored by Tuomas Tynkkynen and committed by Tuomas Tynkkynen 8c4f8c51 8e83158f

+3 -2
+3 -2
pkgs/build-support/vm/default.nix
··· 8 8 }: 9 9 10 10 with pkgs; 11 + with import ../../../nixos/lib/qemu-flags.nix { inherit pkgs; }; 11 12 12 13 rec { 13 14 ··· 197 198 export PATH=/bin:/usr/bin:${coreutils}/bin 198 199 echo "Starting interactive shell..." 199 200 echo "(To run the original builder: \$origBuilder \$origArgs)" 200 - exec ${busybox}/bin/setsid ${bashInteractive}/bin/bash < /dev/ttyS0 &> /dev/ttyS0 201 + exec ${busybox}/bin/setsid ${bashInteractive}/bin/bash < /dev/${qemuSerialDevice} &> /dev/${qemuSerialDevice} 201 202 fi 202 203 ''; 203 204 ··· 212 213 ''${diskImage:+-drive file=$diskImage,if=virtio,cache=unsafe,werror=report} \ 213 214 -kernel ${kernel}/${img} \ 214 215 -initrd ${initrd}/initrd \ 215 - -append "console=ttyS0 panic=1 command=${stage2Init} out=$out mountDisk=$mountDisk loglevel=4" \ 216 + -append "console=${qemuSerialDevice} panic=1 command=${stage2Init} out=$out mountDisk=$mountDisk loglevel=4" \ 216 217 $QEMU_OPTS 217 218 ''; 218 219