From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6449247988281769984 X-Received: by 10.28.74.147 with SMTP id n19mr20511wmi.27.1501786016439; Thu, 03 Aug 2017 11:46:56 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.21.81 with SMTP id 17ls171248ljv.52.gmail; Thu, 03 Aug 2017 11:46:55 -0700 (PDT) X-Received: by 10.46.9.71 with SMTP id 68mr460762ljj.34.1501786015810; Thu, 03 Aug 2017 11:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501786015; cv=none; d=google.com; s=arc-20160816; b=oCfxLF3bjbC6ueYOSyXaY7Su9c6A3Q9P3A4I/eN4F3QqyslifwBGy0VoH9hq+DyiEA rr2lkHS4NpmSKxPGVAA0yfQvPKs1SUjLg/HHPpRp1IXE8eTQnJR3PNxe1/QMjXgJpHbj 8hZb1ETRhORcexFYoxv9GMrhNl0yeFjSEJAxSMXSAp+/RgX+bO+NoGnhendegaIR9Jz7 Dv5UMU95Bk/XYAueECT7BD2KgF3Gu71HjaiIHfTcQssfLoKKivBETB3vSFUstD4jP3xJ ZS+q2rOv4Uboi2Scx+lg2LsHW9a7uVzQIMtw7ny1ZpXLC2lGee0Qxj/jb9CfwDDzQJAr G3lw== 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=V3TZzwxDTClew+/BdBu6nsSLCIteYWM8kmRAayzyS18=; b=COyIa27RE566rSbJSEomgA2u5DnyMKuG0hT9vHR5EBQ4+YrMjLsdiMEPuz0k10nWw5 JNdJZy3ZPpqJgfUl3I1/fS3R1mtEX29LNveRZWhPdcmBj82wZkFvKDvxSvmN5cPomkaN ntYbhLnN6m+cyd78QxX00gKLeNB3J+lUZa92Ys9lZ4WozLNaUYw2EmRq26E6zRiUvMfb VTPAopnkcnzmnW83VgNHADcqP4MA+bUYF0JFSqqJdr9EEGhQIPnoKP8S9SdUcpdvNXUa ax56Ub6rCfk+/pSlMNnJyrNprUl7S7HvXIjblR/h0QEfEF+QNT/llkik8aCVttPvn18a utaA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 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 david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id 132si1167730wmn.6.2017.08.03.11.46.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 11:46:55 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v73IktMK015814 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 3 Aug 2017 20:46:55 +0200 Received: from md1em3qc ([139.22.106.2]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id v73Iksqb006040; Thu, 3 Aug 2017 20:46:54 +0200 Date: Thu, 3 Aug 2017 20:48:48 +0200 From: Henning Schild To: Jan Kiszka Cc: Subject: Re: [PATCH 16/16] recipes-app/hello-bin: add example on how to use dpkg-bin Message-ID: <20170803204848.5d1262ec@md1em3qc> In-Reply-To: References: <071da159557fdf0987260a0ca20ff1be79cacbed.1501582237.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: E+Wj7FGjcHao Am Wed, 2 Aug 2017 08:33:33 +0200 schrieb Jan Kiszka : > On 2017-08-01 12:17, [ext] Henning Schild wrote: > > Signed-off-by: Henning Schild > > --- > > meta-isar/recipes-app/hello-bin/files/README | 1 + > > meta-isar/recipes-app/hello-bin/files/postinst | 14 +++++++++++++ > > meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb | 26 > > ++++++++++++++++++++++++ 3 files changed, 41 insertions(+) > > create mode 100644 meta-isar/recipes-app/hello-bin/files/README > > create mode 100644 meta-isar/recipes-app/hello-bin/files/postinst > > create mode 100644 meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb > > > > diff --git a/meta-isar/recipes-app/hello-bin/files/README > > b/meta-isar/recipes-app/hello-bin/files/README new file mode 100644 > > index 0000000..6e2ce0f > > --- /dev/null > > +++ b/meta-isar/recipes-app/hello-bin/files/README > > @@ -0,0 +1 @@ > > +This is an example file that we get from FILESDIR in recipe. > > diff --git a/meta-isar/recipes-app/hello-bin/files/postinst > > b/meta-isar/recipes-app/hello-bin/files/postinst new file mode > > 100644 index 0000000..2a9eab6 > > --- /dev/null > > +++ b/meta-isar/recipes-app/hello-bin/files/postinst > > @@ -0,0 +1,14 @@ > > +#!/bin/sh > > + > > +set -e > > + > > +if ! getent group hello >/dev/null; then > > + addgroup --quiet --system hello > > +fi > > + > > +if ! getent passwd hello >/dev/null; then > > + adduser --system --ingroup hello --home /var/lib/hello > > hello \ > > + --gecos "My hello user" > > +fi > > + > > +chown -R hello:hello /var/lib/hello > > Nice. > > > diff --git a/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb > > b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb new file mode > > 100644 index 0000000..5ff12d3 > > --- /dev/null > > +++ b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb > > @@ -0,0 +1,26 @@ > > +# Sample application using dpkg-bin, which turns a folder (${D}) of > > +# files into a .deb > > +# > > +# This software is a part of ISAR. > > + > > +DESCRIPTION = "Sample bin application for ISAR" > > +DEBIAN_MAINTAINER = "Your name here " > > + > > +inherit dpkg-bin > > + > > In contrast to OE/Yocto, we don't need to specify the files we want to > install later on here via SRC_URI? I'm not sure right now that we do > not lose some features when skipping this local fetching steps. We lose caching cleaning and dep-tracking, you are right. Changed that. > > +do_install() { > > + bbnote "Creating ${PN} binary" > > + echo "#!/bin/sh" > ${WORKDIR}/${PN} > > + echo "echo Hello World! ${PN}_${PV}" >> ${WORKDIR}/${PN} > > + > > + bbnote "Putting ${PN} into overlay" > > Nit: Is overlay the right term here? Corrected! > > + install -v -d ${D}/usr/local/bin/ > > + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN} > > + > > + bbnote "Now copy ${FILESDIR}/README to overlay" > > In OE, FILESDIR is deprecated and has been removed already. Probably > not a good idea to introduce it here. FILESPATH is now the standard. > > However: > > "Usage of FILESPATH is discouraged, since it can make recipes harder > to bbappend. Instead FILESEXTRAPATHS should be used to extend the > path." All that is done by SRC_URI now. > > + install -v -d ${D}/usr/local/doc/ > > + install -v -m 644 ${FILESDIR}/README > > ${D}/usr/local/doc/README-${P} + > > + bbnote "Now for a debian hook, see dpkg-deb" > > + install -v -m 755 ${FILESDIR}/postinst > > ${D}/DEBIAN/postinst > > Maybe this could be automated - to avoid boilerplate logic - by > defining some DEBIAN_POSTINST var. dpkg-bin could evaluate that var > and install everything mentioned in it without requiring the user to > do this here manually. Sure, but now we are talking improvements on something that i would like to see getting merged in a first version. So lets hold that for later. Henning > > +} > > > > Jan >