From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6460145516460113920 X-Received: by 10.46.22.26 with SMTP id w26mr132868ljd.18.1504683383767; Wed, 06 Sep 2017 00:36:23 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.92.130 with SMTP id q124ls207715ljb.51.gmail; Wed, 06 Sep 2017 00:36:23 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7Wy/PWquGSd1vUtU+osWt6ZTiIaDDxPM0VLlw8M0kPTQLnK2Lx7ihM2VAaBIYe0/oKN5Av X-Received: by 10.25.22.160 with SMTP id 32mr107601lfw.8.1504683383330; Wed, 06 Sep 2017 00:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504683383; cv=none; d=google.com; s=arc-20160816; b=LoUmsmUprxe1a6kRJV0fYSrfNYEOt7O0x3/8j8D/Mb9L4tmx0lur6vkD+9qowqzHno 3mAruEo4CXUhDYwKAOvmLHGE15U2Q772YuyTErcGo7GBlPHGe09Ooc3nYZgGYvhLG47y Th+gUEmL2uT4TcwmIopzZXFcarzmVzRfvNFVrWC3NYiaFZRe1T7+/6HYitn4CWYYGrqh YHBKMXA03oQOw+Crr19gLwYREygeTqMgrBJKBNPtEXQ3qfHup0TAbHM+0p4e2nnAivaH NS9Psuu8Cizg21AOl48dfxyKAW/mfLlQWqpNEcpSVdZXdPnZnpx7HnA98VcqFMze9d3C UrEQ== 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:arc-authentication-results; bh=zB1jFt2NQy3uXOjkMIBh8qAsGdEnB+D/MR3yp3cIaXg=; b=ifQlxMjWovdbxgJ1ugE9q+A1dLx752fEgxImOHtcCIcAED197MFX8/GP7il50Uittb tSqtGAv5a25KA2qgUJCInGmAR0t8n2wDcrAAMXxu84KuEToOhQjr5ra6wRSnocN6rBoI pVvGfSQV5bskVXdj2cp7B2Wim49K20W5dsxc/cloBkMbBreNY+QI3OgpdFHJfph/kl4C j31fPYX/WKOYHQTM2Bnz337i1WmmiUnUxmL/RTgIl4HE8Oq1Uj+OV8AT1SWihiPTCkDa 5GQPrgbqpH7nDT9PyGJn1ThAVPFulDfAoE0jqDh6fGF9B+KpIR6Z60Zr0P+9gqGAoK6+ Lxjw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id j199si40358wmg.7.2017.09.06.00.36.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Sep 2017 00:36:23 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v867aMYU027008 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Sep 2017 09:36:23 +0200 Received: from md1em3qc ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v867aMVx006718; Wed, 6 Sep 2017 09:36:22 +0200 Date: Wed, 6 Sep 2017 09:36:31 +0200 From: Henning Schild To: Alexander Smirnov Cc: Subject: Re: [PATCH 6/6] recipes-app/example-custom: add example on how to use dpkg-custom Message-ID: <20170906093631.1be29225@md1em3qc> In-Reply-To: References: <3dabf24441bb486c830ef72df228848206b1bef5.1504119538.git.henning.schild@siemens.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: 6d+FUFCdkAR9 Am Mon, 4 Sep 2017 18:40:20 +0300 schrieb Alexander Smirnov : > On 08/30/2017 10:03 PM, Henning Schild wrote: > > Issue: > > It might not be clear to a user how to make use of the class > > dpkg-custom. > > > > Change: > > Add an example that demonstrates some features. > > > > Impact: > > This patch does not change the behaviour of Isar. It addresses the > > issue partially, documentation would also be useful. > > > > Signed-off-by: Henning Schild > > --- > > .../example-custom/example-custom_0.1.bb | 35 > > ++++++++++++++++++++++ > > meta-isar/recipes-app/example-custom/files/README | 1 > > + .../recipes-app/example-custom/files/postinst | 16 > > ++++++++++ 3 files changed, 52 insertions(+) create mode 100644 > > meta-isar/recipes-app/example-custom/example-custom_0.1.bb create > > mode 100644 meta-isar/recipes-app/example-custom/files/README > > create mode 100644 > > meta-isar/recipes-app/example-custom/files/postinst > > > > diff --git > > a/meta-isar/recipes-app/example-custom/example-custom_0.1.bb > > b/meta-isar/recipes-app/example-custom/example-custom_0.1.bb new > > file mode 100644 index 0000000..efa813e --- /dev/null > > +++ b/meta-isar/recipes-app/example-custom/example-custom_0.1.bb > > @@ -0,0 +1,35 @@ > > +# Sample application using dpkg-custom, which turns a folder > > (${D}) of +# files into a .deb > > +# > > +# This software is a part of ISAR. > > + > > +DESCRIPTION = "Sample application for ISAR" > > +MAINTAINER = "Your name here " > > +DEBIAN_DEPENDS = "apt" > > + > > +SRC_URI = "file://README \ > > + file://postinst" > > + > > +inherit dpkg-custom > > + > > +do_populate_package() { > > + bbnote "Creating ${PN} binary" > > + echo "#!/bin/sh" > ${WORKDIR}/${PN} > > + echo "echo Hello ISAR! ${PN}_${PV}" >> ${WORKDIR}/${PN} > > + > > + bbnote "Putting ${PN} into package" > > + install -v -d ${D}/usr/local/bin/ > > + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN} > > + > > + bbnote "Now copy ${FILESDIR}/README into package" > > + install -v -d ${D}/usr/local/doc/ > > + install -v -m 644 ${WORKDIR}/README > > ${D}/usr/local/doc/README-${P} + > > + bbnote "Now for a debian hook, see dpkg-deb" > > + install -v -m 755 ${WORKDIR}/postinst ${D}/DEBIAN/postinst > > + > > + bbnote "Now for a fake config file" > > + echo "# empty config file" > ${WORKDIR}/${PN}.conf > > + install -v -d ${D}/usr/local/etc/ > > + install -v -m 644 ${WORKDIR}/${PN}.conf > > ${D}/usr/local/etc/${PN}.conf +} > > diff --git a/meta-isar/recipes-app/example-custom/files/README > > b/meta-isar/recipes-app/example-custom/files/README new file mode > > 100644 index 0000000..6e2ce0f > > --- /dev/null > > +++ b/meta-isar/recipes-app/example-custom/files/README > > @@ -0,0 +1 @@ > > +This is an example file that we get from FILESDIR in recipe. > > diff --git a/meta-isar/recipes-app/example-custom/files/postinst > > b/meta-isar/recipes-app/example-custom/files/postinst new file mode > > 100644 index 0000000..a28afa3 > > --- /dev/null > > +++ b/meta-isar/recipes-app/example-custom/files/postinst > > @@ -0,0 +1,16 @@ > > +#!/bin/sh > > + > > +set -e > > + > > +if ! getent group isar >/dev/null; then > > + addgroup --quiet --system isar > > +fi > > + > > +if ! getent passwd isar >/dev/null; then > > + useradd --system --gid isar --create-home \ > > + --home /var/lib/isar --no-user-group \ > > + --comment "My isar user" \ > > + isar > > +fi > > + > > +chown -R isar:isar /var/lib/isar > > > > That's a good demo scenario. But probably it makes sense to > demonstrate it on real use case, for example set default password for > root. This anyway should be done, probably it's a good time :-) Well unfortunately the root password is special. It is special because everyone probably wants to set it, and i do not want people to start abusing that example to do so. And it is special because the configure-script sets it as well and the question "how and when do custom packages get into the rootfs" has not been decided yet. Once we have answered that question i would be happy to provide patches that move all of the configure-script into hooks. Henning