[elbe-devel] [PATCH] rfs: fix /etc/hosts localhost mapping

Christian Teklenborg chris at linutronix.de
Tue Mar 2 15:15:56 CET 2021


The /etc/hosts file of Elbe-generated targets do not have a localhost
entry. Thus, append it in the seed_etc function.

Addresses to GitHub issue #295.

Signed-off-by: Christian Teklenborg <chris at linutronix.de>
---
 elbepack/rfs.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 4bc58707..5e3b07ac 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -334,6 +334,9 @@ class BuildEnv:
         if self.xml.has("target/domain"):
             fqdn = ("%s.%s" % (hostname, self.xml.text("target/domain")))
 
+        chroot(self.rfs.path,
+               """/bin/sh -c 'echo "127.0.0.1 localhost" >> /etc/hosts'""")
+
         chroot(self.rfs.path,
                """/bin/sh -c 'echo "127.0.1.1 %s %s elbe-daemon" >> """
                """/etc/hosts'""" % (fqdn,hostname))
-- 
2.20.1



More information about the elbe-devel mailing list