diff options
author | Ross Burton <ross.burton@intel.com> | 2015-02-23 17:39:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-24 17:41:43 +0000 |
commit | 0e04c93baee6539874e786aa0c7ac0a6369ce7d4 (patch) | |
tree | b613d7d48a033e1c6860cd1d8ff80cf4404e8bb1 /meta | |
parent | 54567379ac7e8dcc1515bd22439cf1f7acf7f761 (diff) | |
download | poky-0e04c93baee6539874e786aa0c7ac0a6369ce7d4.tar.gz |
base-files: clean up and clarify hostname logic
Change the hostname logic the default value is ${MACHINE}, and explain how to
change it.
(From OE-Core rev: f2588c55fb089371f239dde39efe9d63d8614062)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/base-files/base-files_3.0.14.bb | 19 |
1 files changed, 9 insertions, 10 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 6157ff381a..f2d254e6bd 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 | |||
@@ -59,10 +59,13 @@ conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ | |||
59 | ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \ | 59 | ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \ |
60 | ${sysconfdir}/default" | 60 | ${sysconfdir}/default" |
61 | 61 | ||
62 | # By default the hostname is the machine name. If the hostname is unset then a | ||
63 | # /etc/hostname file isn't written, suitable for environments with dynamic | ||
64 | # hostnames. | ||
62 | # | 65 | # |
63 | # set standard hostname, might be a candidate for a DISTRO variable? :M: | 66 | # The hostname can be changed outside of this recipe by using |
64 | # | 67 | # hostname_pn-base-files = "my-host-name". |
65 | hostname = "openembedded" | 68 | hostname = "${MACHINE}" |
66 | 69 | ||
67 | BASEFILESISSUEINSTALL ?= "do_install_basefilesissue" | 70 | BASEFILESISSUEINSTALL ?= "do_install_basefilesissue" |
68 | 71 | ||
@@ -111,15 +114,11 @@ do_install () { | |||
111 | 114 | ||
112 | DISTRO_VERSION[vardepsexclude] += "DATE" | 115 | DISTRO_VERSION[vardepsexclude] += "DATE" |
113 | do_install_basefilesissue () { | 116 | do_install_basefilesissue () { |
114 | if [ "${hostname}" != "" ]; then | 117 | if [ "${hostname}" ]; then |
115 | if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then | 118 | echo ${hostname} > ${D}${sysconfdir}/hostname |
116 | echo ${MACHINE} > ${D}${sysconfdir}/hostname | ||
117 | else | ||
118 | echo ${hostname} > ${D}${sysconfdir}/hostname | ||
119 | fi | ||
120 | fi | 119 | fi |
121 | 120 | ||
122 | install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} | 121 | install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} |
123 | if [ -n "${DISTRO_NAME}" ]; then | 122 | if [ -n "${DISTRO_NAME}" ]; then |
124 | printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue | 123 | printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue |
125 | printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net | 124 | printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net |