[OE-core] [PATCH] base-files: Allow setting hostname through DISTRO_HOSTNAME

Soren Brinkmann soren.brinkmann at xilinx.com
Thu Sep 11 20:33:56 UTC 2014


Add a distro variable to set the hostname. This allows easily assigning
a hostname in local.conf.

Signed-off-by: Soren Brinkmann <soren.brinkmann at xilinx.com>
---
 meta/conf/documentation.conf                      | 1 +
 meta/recipes-core/base-files/base-files_3.0.14.bb | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index dd556857699a..970ce11d96bb 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -139,6 +139,7 @@ DISTRO_EXTRA_RRECOMMENDS[doc] = "Specifies a list of distro-specific packages to
 DISTRO_FEATURES[doc] = "The features enabled for the distribution."
 DISTRO_FEATURES_BACKFILL[doc] = "Features to be added to DISTRO_FEATURES if not also present in DISTRO_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and it is not intended to be user-configurable."
 DISTRO_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from DISTRO_FEATURES_BACKFILL that should not be backfilled (i.e. added to DISTRO_FEATURES) during the build."
+DISTRO_HOSTNAME[doc] = "The hostname used in the image."
 DISTRO_NAME[doc] = "The long name of the distribution."
 DISTRO_PN_ALIAS[doc] = "Alias names used for the recipe in various Linux distributions."
 DISTRO_VERSION[doc] = "The version of the distribution."
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 07f5c54c97d8..71405ddc5337 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
@@ -60,9 +60,10 @@ conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
              ${sysconfdir}/default"
 
 #
-# set standard hostname, might be a candidate for a DISTRO variable? :M:
+# set standard hostname
 #
-hostname = "openembedded"
+DISTRO_HOSTNAME ?= "openembedded"
+hostname = "${DISTRO_HOSTNAME}"
 
 BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
 
-- 
2.1.0.1.g27b9230




More information about the Openembedded-core mailing list