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

Bastian Germann bage at linutronix.de
Tue Mar 2 15:37:43 CET 2021


Am 02.03.21 um 15:15 schrieb Christian Teklenborg:
> 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.

No "to".

> 
> Signed-off-by: Christian Teklenborg <chris at linutronix.de>

With the wording fixed:
Reviewed-by: Bastian Germann <bage 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))
> 


More information about the elbe-devel mailing list