diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2019-01-08 17:12:52 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-11 10:39:08 +0000 |
commit | 53cebfdfcc189a65de82eccdbd18acf4d979e624 (patch) | |
tree | 772c4e40dc35af47a39efa425794ad787448fa11 /meta/recipes-core/base-files | |
parent | 4dd51032160897be4132242d6aaaf4dd1e5167da (diff) | |
download | poky-53cebfdfcc189a65de82eccdbd18acf4d979e624.tar.gz |
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.
(From OE-Core rev: 31e6d08f20a804fccb958e19045d8f9e9806071a)
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/hosts | 8 | ||||
-rw-r--r-- | meta/recipes-core/base-files/base-files_3.0.14.bb | 5 |
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 @@ | |||
1 | 127.0.0.1 localhost.localdomain localhost | ||
2 | |||
3 | # The following lines are desirable for IPv6 capable hosts | ||
4 | ::1 localhost ip6-localhost ip6-loopback | ||
5 | fe00::0 ip6-localnet | ||
6 | ff00::0 ip6-mcastprefix | ||
7 | ff02::1 ip6-allnodes | ||
8 | 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" | |||
13 | SRC_URI = "file://rotation \ | 13 | SRC_URI = "file://rotation \ |
14 | file://nsswitch.conf \ | 14 | file://nsswitch.conf \ |
15 | file://motd \ | 15 | file://motd \ |
16 | file://hosts \ | ||
16 | file://host.conf \ | 17 | file://host.conf \ |
17 | file://profile \ | 18 | file://profile \ |
18 | file://shells \ | 19 | file://shells \ |
@@ -113,6 +114,7 @@ do_install () { | |||
113 | ln -snf ../run ${D}${localstatedir}/run | 114 | ln -snf ../run ${D}${localstatedir}/run |
114 | ln -snf ../run/lock ${D}${localstatedir}/lock | 115 | ln -snf ../run/lock ${D}${localstatedir}/lock |
115 | 116 | ||
117 | install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts | ||
116 | ${BASEFILESISSUEINSTALL} | 118 | ${BASEFILESISSUEINSTALL} |
117 | 119 | ||
118 | rotation=`cat ${WORKDIR}/rotation` | 120 | rotation=`cat ${WORKDIR}/rotation` |
@@ -140,6 +142,7 @@ DISTRO_VERSION[vardepsexclude] += "DATE" | |||
140 | do_install_basefilesissue () { | 142 | do_install_basefilesissue () { |
141 | if [ "${hostname}" ]; then | 143 | if [ "${hostname}" ]; then |
142 | echo ${hostname} > ${D}${sysconfdir}/hostname | 144 | echo ${hostname} > ${D}${sysconfdir}/hostname |
145 | echo "127.0.1.1 ${hostname}" >> ${D}${sysconfdir}/hosts | ||
143 | fi | 146 | fi |
144 | 147 | ||
145 | install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} | 148 | install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} |
@@ -177,5 +180,5 @@ FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses" | |||
177 | 180 | ||
178 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 181 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
179 | 182 | ||
180 | CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname') != '')]} ${sysconfdir}/shells" | 183 | CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname ${sysconfdir}/hosts'][(d.getVar('hostname') != '')]} ${sysconfdir}/shells" |
181 | CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile" | 184 | CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile" |