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.

(From OE-Core rev: c3d9cff06f383528884bfb5c4f8a6a6cb023977a)

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jörg Sommer
2023-10-16 12:31:23 +02:00
committed by Richard Purdie
parent 16dc1bb3de
commit 6f18993c84

View File

@@ -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 () {