All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][V2] base-files: clean up and clarify hostname logic
@ 2015-02-23 17:39 Ross Burton
  2015-02-23 18:14 ` Christopher Larson
  0 siblings, 1 reply; 2+ messages in thread
From: Ross Burton @ 2015-02-23 17:39 UTC (permalink / raw)
  To: openembedded-core

Change the hostname logic the default value is ${MACHINE}, and explain how to
change it.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb |   19 +++++++++----------
 1 file 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 6157ff3..f2d254e 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
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][V2] base-files: clean up and clarify hostname logic
  2015-02-23 17:39 [PATCH][V2] base-files: clean up and clarify hostname logic Ross Burton
@ 2015-02-23 18:14 ` Christopher Larson
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Larson @ 2015-02-23 18:14 UTC (permalink / raw)
  To: Ross Burton; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

On Mon, Feb 23, 2015 at 10:39 AM, Ross Burton <ross.burton@intel.com> wrote:

> Change the hostname logic the default value is ${MACHINE}, and explain how
> to
> change it.
>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
>

Looks good, other than the grammar issue in the commit message. "Change the
hostname logic the default value" :)

Acked-by: Christopher Larson <chris_larson@mentor.com>
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1296 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-23 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23 17:39 [PATCH][V2] base-files: clean up and clarify hostname logic Ross Burton
2015-02-23 18:14 ` Christopher Larson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.