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-23 18:00:12 +0000 |
commit | f2588c55fb089371f239dde39efe9d63d8614062 (patch) | |
tree | 902171caddb940bdfd5a0a720a2db2404814ef3e /meta/recipes-core/base-files | |
parent | bf81d6bb7f6df5405b8f2148e2a22e0030c12757 (diff) | |
download | openembedded-core-f2588c55fb089371f239dde39efe9d63d8614062.tar.gz openembedded-core-f2588c55fb089371f239dde39efe9d63d8614062.tar.bz2 openembedded-core-f2588c55fb089371f239dde39efe9d63d8614062.zip |
base-files: clean up and clarify hostname logic
Change the hostname logic the default value is ${MACHINE}, and explain how to
change it.
Signed-off-by: Ross Burton <ross.burton@intel.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_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 \ ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \ ${sysconfdir}/default" +# By default the hostname is the machine name. If the hostname is unset then a +# /etc/hostname file isn't written, suitable for environments with dynamic +# hostnames. # -# set standard hostname, might be a candidate for a DISTRO variable? :M: -# -hostname = "openembedded" +# The hostname can be changed outside of this recipe by using +# hostname_pn-base-files = "my-host-name". +hostname = "${MACHINE}" BASEFILESISSUEINSTALL ?= "do_install_basefilesissue" @@ -111,15 +114,11 @@ do_install () { DISTRO_VERSION[vardepsexclude] += "DATE" do_install_basefilesissue () { - if [ "${hostname}" != "" ]; then - if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then - echo ${MACHINE} > ${D}${sysconfdir}/hostname - else - echo ${hostname} > ${D}${sysconfdir}/hostname - fi + if [ "${hostname}" ]; then + echo ${hostname} > ${D}${sysconfdir}/hostname fi - install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} + install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} if [ -n "${DISTRO_NAME}" ]; then printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net |