summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/base-files
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-01-08 17:12:52 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-08 13:27:16 +0000
commit31e6d08f20a804fccb958e19045d8f9e9806071a (patch)
tree846dc10e8ce976e0655d744e8eeb0f96300a062d /meta/recipes-core/base-files
parent237ed166f48b0e32684a5307d3b47b9485238ed9 (diff)
downloadopenembedded-core-contrib-31e6d08f20a804fccb958e19045d8f9e9806071a.tar.gz
openembedded-core-contrib-31e6d08f20a804fccb958e19045d8f9e9806071a.tar.bz2
openembedded-core-contrib-31e6d08f20a804fccb958e19045d8f9e9806071a.zip
netbase/base-files: move /etc/hosts from netbase to base-files
Move /etc/hosts to base-files, and also add entry to it according to hostname setting. This fixes the problem of commands like `hostname -f' failing due to lack of such entry. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/base-files')
-rw-r--r--meta/recipes-core/base-files/base-files/hosts8
-rw-r--r--meta/recipes-core/base-files/base-files_3.0.14.bb5
2 files changed, 12 insertions, 1 deletions
diff --git a/meta/recipes-core/base-files/base-files/hosts b/meta/recipes-core/base-files/base-files/hosts
new file mode 100644
index 0000000000..b94f414d5c
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/hosts
@@ -0,0 +1,8 @@
+127.0.0.1 localhost.localdomain localhost
+
+# The following lines are desirable for IPv6 capable hosts
+::1 localhost ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
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 6e75652f15..6e30c149ba 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
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f"
SRC_URI = "file://rotation \
file://nsswitch.conf \
file://motd \
+ file://hosts \
file://host.conf \
file://profile \
file://shells \
@@ -113,6 +114,7 @@ do_install () {
ln -snf ../run ${D}${localstatedir}/run
ln -snf ../run/lock ${D}${localstatedir}/lock
+ install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
${BASEFILESISSUEINSTALL}
rotation=`cat ${WORKDIR}/rotation`
@@ -140,6 +142,7 @@ DISTRO_VERSION[vardepsexclude] += "DATE"
do_install_basefilesissue () {
if [ "${hostname}" ]; then
echo ${hostname} > ${D}${sysconfdir}/hostname
+ echo "127.0.1.1 ${hostname}" >> ${D}${sysconfdir}/hosts
fi
install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
@@ -177,5 +180,5 @@ FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
PACKAGE_ARCH = "${MACHINE_ARCH}"
-CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname') != '')]} ${sysconfdir}/shells"
+CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname ${sysconfdir}/hosts'][(d.getVar('hostname') != '')]} ${sysconfdir}/shells"
CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"