mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-03 17:33:26 +03:00
* Fix networking in the installer test.
* If connecting to the host fails in the guest, then shutdown immediately. svn path=/nixos/branches/boot-order/; revision=22341
This commit is contained in:
parent
411139148d
commit
20a88efffa
@ -28,7 +28,7 @@ sub new {
|
|||||||
# !!! merge with qemu-vm.nix.
|
# !!! merge with qemu-vm.nix.
|
||||||
$startCommand =
|
$startCommand =
|
||||||
"qemu-system-x86_64 -m 384 " .
|
"qemu-system-x86_64 -m 384 " .
|
||||||
"-net nic,model=virtio -net user \$QEMU_OPTS ";
|
"-net nic,model=virtio -net user,\$QEMU_NET_OPTS \$QEMU_OPTS ";
|
||||||
$startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=virtio,boot=on,werror=report "
|
$startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=virtio,boot=on,werror=report "
|
||||||
if defined $args->{hda};
|
if defined $args->{hda};
|
||||||
$startCommand .= "-cdrom $args->{cdrom} "
|
$startCommand .= "-cdrom $args->{cdrom} "
|
||||||
|
@ -24,7 +24,8 @@ in
|
|||||||
config = {
|
config = {
|
||||||
|
|
||||||
jobs.backdoor =
|
jobs.backdoor =
|
||||||
{ startOn = "started network-interfaces";
|
{ startOn = "ip-up";
|
||||||
|
stopOn = "never";
|
||||||
|
|
||||||
script =
|
script =
|
||||||
''
|
''
|
||||||
@ -35,8 +36,10 @@ in
|
|||||||
source /etc/profile
|
source /etc/profile
|
||||||
cd /tmp
|
cd /tmp
|
||||||
echo "connecting to host..." > /dev/ttyS0
|
echo "connecting to host..." > /dev/ttyS0
|
||||||
exec ${pkgs.socat}/bin/socat tcp:10.0.2.6:23 exec:${rootShell} 2> /dev/ttyS0
|
${pkgs.socat}/bin/socat tcp:10.0.2.6:23 exec:${rootShell} 2> /dev/ttyS0 || poweroff -f
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
respawn = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.postBootCommands =
|
boot.postBootCommands =
|
||||||
|
Loading…
Reference in New Issue
Block a user