From 6f18993c8484f5b375534fc519632ef7145c80d3 Mon Sep 17 00:00:00 2001 From: Jörg Sommer Date: Mon, 16 Oct 2023 12:31:23 +0200 Subject: base-files: Remove localhost ::1 from hosts if ipv6 missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a distribution doesn't provide IPv6, the mapping of localhost and ::1 has to be removed. (From OE-Core rev: c3d9cff06f383528884bfb5c4f8a6a6cb023977a) Signed-off-by: Jörg Sommer Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb index 6ba3971e32..4d246126a2 100644 --- a/meta/recipes-core/base-files/base-files_3.0.14.bb +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb @@ -136,6 +136,10 @@ do_install () { echo ${hostname} > ${D}${sysconfdir}/hostname echo "127.0.1.1 ${hostname}" >> ${D}${sysconfdir}/hosts fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'false', 'true', d)}; then + sed -i '/^::1/s/ localhost//' ${D}${sysconfdir}/hosts + fi } do_install:append:libc-glibc () { -- cgit v1.2.3-54-g00ecf