Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH V2] base-files: provide a mechanism to skip creation of the hostname file
@ 2012-08-28 18:20 Mark Asselstine
  2012-08-28 18:38 ` Phil Blundell
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Asselstine @ 2012-08-28 18:20 UTC (permalink / raw)
  To: openembedded-core

The existence of a /etc/hostname file causes any hostname provided on
the kernel command line or via dhcp to be overwritten by the
initscripts 'init.d/hostname.sh'. This change allows you to set a
value of 'none' for 'hostname' which will skip the creation of the
/etc/hostname file by the base-files package.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
V2: Koen Kooi didn't want to see the handling of the hostname variable
    changed so I removed those changes and just focused on the creation
    of the /etc/hostname file.

  Changes from V1:
  * patch renamed, was 
    "base-files: allow for more flexibility related to hostname",
  * removed the rename of hostname to MACHINE_HOSTNAME
  * removed the addition made to meta/conf/local.conf.sample

 meta/recipes-core/base-files/base-files_3.0.14.bb |   10 ++++++----
 1 file changed, 6 insertions(+), 4 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 6bab040..dfcca78 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
@@ -107,10 +107,12 @@ do_install () {
 }
 
 do_install_basefilesissue () {
-	if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then
-		echo ${MACHINE} > ${D}${sysconfdir}/hostname
-	else
-		echo ${hostname} > ${D}${sysconfdir}/hostname
+	if [ "${hostname}" != "none" ]; then
+		if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then
+			echo ${MACHINE} > ${D}${sysconfdir}/hostname
+		else
+			echo ${hostname} > ${D}${sysconfdir}/hostname
+		fi
 	fi
 
 	install -m 644 ${WORKDIR}/issue*  ${D}${sysconfdir}  
-- 
1.7.9.5




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

end of thread, other threads:[~2012-09-07 18:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-28 18:20 [PATCH V2] base-files: provide a mechanism to skip creation of the hostname file Mark Asselstine
2012-08-28 18:38 ` Phil Blundell
2012-08-28 18:53   ` Mark Asselstine
2012-08-28 19:16     ` Burton, Ross
2012-08-28 20:01       ` Mark Asselstine
2012-08-28 20:11         ` Burton, Ross
2012-08-30 17:20           ` Mark Asselstine
2012-09-07 18:09             ` Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox