public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: "[ext] claudius.heine.ext@siemens.com" <claudius.heine.ext@siemens.com>
Cc: <isar-users@googlegroups.com>, Claudius Heine <ch@denx.de>
Subject: Re: [RFC PATCH 2/2] meta: add isar-cfg-hostname recipe for setting the hostname
Date: Wed, 6 Feb 2019 13:15:00 +0100	[thread overview]
Message-ID: <20190206131500.636a86d9@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20190205134235.27523-3-claudius.heine.ext@siemens.com>

This one is similar to the rootpw, but it is not as important. An
unexpected hostname will only render your target not-usable if you made
a few more mistakes.
So i guess this one should wait until we have a pattern from the
password recipe.

Henning

Am Tue, 5 Feb 2019 14:42:35 +0100
schrieb "[ext] claudius.heine.ext@siemens.com"
<claudius.heine.ext@siemens.com>:

> From: Claudius Heine <ch@denx.de>
> 
> The isar-cfg-hostname recipe is a central point to set the hostname
> for images. It provides the `CFG_HOSTNAME` variables, which can be set
> from any `.conf` file or via `isar-cfg-hostname.bbappend` to the
> hostname that should be used. The default is 'isar'.
> 
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
>  meta-isar/conf/local.conf.sample                 |  2 +-
>  meta-isar/recipes-app/example-raw/files/postinst |  2 --
>  .../isar-cfg-hostname/files/postinst.tmpl        |  8 ++++++++
>  .../isar-cfg-hostname/isar-cfg-hostname.bb       | 16
> ++++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-)
>  create mode 100644
> meta/recipes-support/isar-cfg-hostname/files/postinst.tmpl create
> mode 100644
> meta/recipes-support/isar-cfg-hostname/isar-cfg-hostname.bb
> 
> diff --git a/meta-isar/conf/local.conf.sample
> b/meta-isar/conf/local.conf.sample index a2bdd7e..ddd15a4 100644
> --- a/meta-isar/conf/local.conf.sample
> +++ b/meta-isar/conf/local.conf.sample
> @@ -162,7 +162,7 @@ CONF_VERSION = "1"
>  #
>  # The default list of extra packages to be installed.
>  IMAGE_INSTALL = "hello-isar example-raw
> example-module-${KERNEL_NAME} enable-fsck \
> -                 isar-cfg-rootpw"
> +                 isar-cfg-rootpw isar-cfg-hostname"
>  
>  #
>  # Enable cross-compilation support
> diff --git a/meta-isar/recipes-app/example-raw/files/postinst
> b/meta-isar/recipes-app/example-raw/files/postinst index
> f48d993..a28afa3 100644 ---
> a/meta-isar/recipes-app/example-raw/files/postinst +++
> b/meta-isar/recipes-app/example-raw/files/postinst @@ -14,5 +14,3 @@
> if ! getent passwd isar >/dev/null; then fi
>  
>  chown -R isar:isar /var/lib/isar
> -
> -echo "isar" > /etc/hostname
> diff --git
> a/meta/recipes-support/isar-cfg-hostname/files/postinst.tmpl
> b/meta/recipes-support/isar-cfg-hostname/files/postinst.tmpl new file
> mode 100644 index 0000000..b46433b --- /dev/null
> +++ b/meta/recipes-support/isar-cfg-hostname/files/postinst.tmpl
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +set -e
> +if [ ! -e "/etc/hostname"  ]; then
> +    echo "${CFG_HOSTNAME}" > /etc/hostname
> +else
> +    echo "/etc/hostname already exists, error" >&2
> +    exit -1
> +fi
> diff --git
> a/meta/recipes-support/isar-cfg-hostname/isar-cfg-hostname.bb
> b/meta/recipes-support/isar-cfg-hostname/isar-cfg-hostname.bb new
> file mode 100644 index 0000000..aa41f73 --- /dev/null
> +++ b/meta/recipes-support/isar-cfg-hostname/isar-cfg-hostname.bb
> @@ -0,0 +1,16 @@
> +# This software is a part of ISAR.
> +
> +DESCRIPTION = "Isar configuration package for hostname"
> +MAINTAINER = "isar-users <isar-users@googlegroups.com>"
> +
> +SRC_URI = "file://postinst.tmpl"
> +
> +TEMPLATE_FILES = "postinst.tmpl"
> +TEMPLATE_VARS = "CFG_HOSTNAME"
> +CFG_HOSTNAME ??= "isar"
> +
> +inherit dpkg-raw
> +
> +do_install() {
> +    echo "intentionally left blank"
> +}


      reply	other threads:[~2019-02-06 12:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 13:42 [RFC PATCH 0/2] Centralize root password and hostname setting claudius.heine.ext
2019-02-05 13:42 ` [RFC PATCH 1/2] meta: add isar-cfg-rootpw recipe for setting root password claudius.heine.ext
2019-02-06 12:12   ` Henning Schild
2019-02-05 13:42 ` [RFC PATCH 2/2] meta: add isar-cfg-hostname recipe for setting the hostname claudius.heine.ext
2019-02-06 12:15   ` Henning Schild [this message]

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=20190206131500.636a86d9@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=ch@denx.de \
    --cc=claudius.heine.ext@siemens.com \
    --cc=isar-users@googlegroups.com \
    /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