From 51a22a8f8ac56ad4c827ff89616d068315187689 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Fri, 5 Jul 2013 15:02:43 +0200 Subject: [PATCH] Add loopback network device and localhost entry to /etc/hosts for VM tests. --- pkgs/build-support/vm/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 097fcf21c1b6..c184e8af0fad 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -99,6 +99,8 @@ rec { mount -t tmpfs none /dev ${createDeviceNodes "/dev"} + ifconfig lo up + mkdir /fs if test -z "$mountDisk"; then @@ -129,6 +131,7 @@ rec { mkdir -p /fs/etc ln -sf /proc/mounts /fs/etc/mtab + echo "127.0.0.1 localhost" > /fs/etc/hosts echo "Now running: $command" test -n "$command"