From 4e1ea17052b4cc2445bc2ece2136f248112b4e45 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Mon, 21 Nov 2011 15:19:51 +0000 Subject: nix: add /etc/hosts with localhost entry to chroot builds. --- src/libstore/build.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index d12f41d66941..171c08913255 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1650,6 +1650,9 @@ void DerivationGoal::startBuilder() (format("nixbld:!:%1%:\n") % (buildUser.enabled() ? buildUser.getGID() : getgid())).str()); + /* Create /etc/hosts with localhost entry. */ + writeFile(chrootRootDir + "/etc/hosts", "127.0.0.1 localhost\n"); + /* Bind-mount a user-configurable set of directories from the host file system. The `/dev/pts' directory must be mounted separately so that newly-created pseudo-terminals show -- cgit 1.4.1