From patchwork Tue Aug 28 18:20:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V2] base-files: provide a mechanism to skip creation of the hostname file Date: Tue, 28 Aug 2012 18:20:28 -0000 From: Mark Asselstine X-Patchwork-Id: 35471 Message-Id: <1346178028-2036-1-git-send-email-mark.asselstine@windriver.com> To: 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 --- 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}