summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorJörg Sommer <joerg.sommer@navimatix.de>2023-10-16 12:31:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-19 13:38:54 +0100
commitc3d9cff06f383528884bfb5c4f8a6a6cb023977a (patch)
tree40d405299b64127bfac847df7f6f51be02dee6f0 /meta/recipes-core
parentf1109380a4fec02dba0b5bd50c77b4825faa20a2 (diff)
downloadopenembedded-core-contrib-c3d9cff06f383528884bfb5c4f8a6a6cb023977a.tar.gz
base-files: Remove localhost ::1 from hosts if ipv6 missing
If a distribution doesn't provide IPv6, the mapping of localhost and ::1 has to be removed. Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/base-files/base-files_3.0.14.bb4
1 files changed, 4 insertions, 0 deletions
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 () {