]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Add /etc/hosts to chroot which will resolve localhost.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Mar 2010 22:10:07 +0000 (23:10 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Mar 2010 22:10:07 +0000 (23:10 +0100)
Indirectly fixes bug #596.

naoki/chroot.py

index 73c29dacd577ebc5b6e639d763ee4b996176f132..0050af577e7baac922ebb5568facd4a5629c58b6 100644 (file)
@@ -238,6 +238,11 @@ class Environment(object):
                        f.write("nameserver %s" % nameserver)
                f.close()
 
+               self.log.debug("Creating record for localhost")
+               f = open(self.chrootPath("etc", "hosts"), "w")
+               f.write("127.0.0.1 localhost\n")
+               f.close()
+
        def _mountall(self):
                """mount 'normal' fs like /dev/ /proc/ /sys"""
                for cmd in self.mountCmds: