From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6654511350878830592 X-Received: by 2002:adf:fdcd:: with SMTP id i13mr572784wrs.32.1549455302901; Wed, 06 Feb 2019 04:15:02 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:840e:: with SMTP id g14ls331660wmd.5.canary-gmail; Wed, 06 Feb 2019 04:15:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IbcS+kiVUjuZboNnf+OE6w+7/w9qkmJzfd4AQQqXLUOQVuraQ0WmyzYv7Bg5KkeKIp2V89U X-Received: by 2002:a7b:c414:: with SMTP id k20mr270483wmi.8.1549455302433; Wed, 06 Feb 2019 04:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549455302; cv=none; d=google.com; s=arc-20160816; b=eafxG59VV+gPGQmQW5vIuMFjapOReXU3fWZKvUdnFqtngIVlnvxo5zW884EjJP8BVn zIM49o69JQOvPrHS8BcrY6OuffYF9SI0mZKeKQvRC46+kovxITjQggF+QlKntj08ABO7 vsMO4ymdbN0l1HMmJAw+X3lXHj6SldbFIHSdwWuBoS2+YFXVpo1k4sIna+v6sx2uqD/y VxYSERSHVFCWfEijFXrKXtzo1HTN0Iq585ntpEv5oIc1Nnb+EOdhQ8uyKfiPcKkGygV+ FNIz7RVxq8ROcqyxFljWCOYo6drPTjAXVPO4okaOQK66QhDEjoLmKFBDmstElWkw3zrG Cptw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=1n8HgocmHcbGi0IL9nVt607L6u2Qkxwd7E2WnT0FcnM=; b=X3fe/X5ff7V9f1u9shAD1pdUixfg6297FWjqKcmC2h5mVDF2UyIvDk3H04/XEHsn8l uGTg2Br7qcEKaT9o436aTF73dbVvizfrEFxEUyD3izX4mJtypltDnuVu9D/FeWaQi2Bh UCfF8terPxVDr1Gi7QuMt094wQswM9YeMkdXffoidtxQyZ0VSRSGx9BA+KLhqWd7v7nS ez6LYstgi838FDP68p6SPMdWZi3vHgf9Gswj9gpqW4v29GExmQ5AwcoS5CKi8hKJYnk+ rq7X3DLTvAr8+WJe3wY/Cw0I3Po7Qpu33sHB1Ky/ReUWbXjuZNHb+RQqDXXTUiRASTd2 o3Pg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id z207si749280wmc.2.2019.02.06.04.15.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 04:15:02 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id x16CF1pa015309 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Feb 2019 13:15:01 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.69.48]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x16CF0OG010377; Wed, 6 Feb 2019 13:15:00 +0100 Date: Wed, 6 Feb 2019 13:15:00 +0100 From: Henning Schild To: "[ext] claudius.heine.ext@siemens.com" Cc: , Claudius Heine Subject: Re: [RFC PATCH 2/2] meta: add isar-cfg-hostname recipe for setting the hostname Message-ID: <20190206131500.636a86d9@md1za8fc.ad001.siemens.net> In-Reply-To: <20190205134235.27523-3-claudius.heine.ext@siemens.com> References: <20190205134235.27523-1-claudius.heine.ext@siemens.com> <20190205134235.27523-3-claudius.heine.ext@siemens.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: wev1RAHZMEoS 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" : > From: Claudius Heine > > 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 > --- > 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 " > + > +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" > +}