From: Mark Hatle <mark.hatle@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH V3] base-files: provide a mechanism to skip creation of the hostname file
Date: Fri, 7 Sep 2012 18:08:22 -0500 [thread overview]
Message-ID: <504A7E66.1040208@windriver.com> (raw)
In-Reply-To: <1347058278.9270.4.camel@ted>
On 9/7/12 5:51 PM, Richard Purdie wrote:
> On Fri, 2012-09-07 at 16:51 -0500, Mark Hatle wrote:
>> From: Mark Asselstine <mark.asselstine@windriver.com>
>>
>> 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 "" 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>
>> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
>> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
>> ---
>> meta/recipes-core/base-files/base-files_3.0.14.bb | 12 +++++++-----
>> 1 files changed, 7 insertions(+), 5 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..cda13f4 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}" != "" ]; then
>> + if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then
>> + echo ${MACHINE} > ${D}${sysconfdir}/hostname
>> + else
>> + echo ${hostname} > ${D}${sysconfdir}/hostname
>> + fi
>> fi
>
>
> Is this missing a hostname ??= "openembedded" perhaps?
There is already a hostname = "openembedded" in the package. Nothing in that
part was changed by this patch. The normal override process is to define
hostname_override = "newhostname".
I verified this is working properly.
--Mark
> Cheers,
>
> Richard
>
>> install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
>> @@ -144,5 +146,5 @@ FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
>>
>> PACKAGE_ARCH = "${MACHINE_ARCH}"
>>
>> -CONFFILES_${PN} = "${sysconfdir}/fstab ${sysconfdir}/hostname"
>> +CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]}"
>>
>
>
next prev parent reply other threads:[~2012-09-07 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 21:51 [PATCH V3] base-files: provide a mechanism to skip creation of the hostname file Mark Hatle
2012-09-07 22:51 ` Richard Purdie
2012-09-07 23:08 ` Mark Hatle [this message]
2012-09-08 8:59 ` Koen Kooi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=504A7E66.1040208@windriver.com \
--to=mark.hatle@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox