From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6449247988281769984 X-Received: by 10.28.19.77 with SMTP id 74mr224112wmt.24.1501655614747; Tue, 01 Aug 2017 23:33:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.39.134 with SMTP id n128ls574181wmn.10.gmail; Tue, 01 Aug 2017 23:33:34 -0700 (PDT) X-Received: by 10.28.132.144 with SMTP id g138mr224006wmd.5.1501655614341; Tue, 01 Aug 2017 23:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501655614; cv=none; d=google.com; s=arc-20160816; b=rAI0goGsL4alKM9oRDv5U0mrbSXer3x7uxEqSELUwUV4iyMU7vLhhL2WSDpwktjIsn WOwZMUzGmHVWF5ik0+Wp1iI6tqgJBIdqonZG5PZ4B8SCeSyXosjVsHKHhhosGo4EDng5 axFHgwUpI3solyHzo+zFdfqGhHtbZdFmpn+SvR0O1Wrh3IhcCMCHKL888F6SCuvQV7Rx y80dMYNZttkdc+r09Lo5+u1inHHZTwZBxjXBixl+ZoQWUwT841z+THvsapUjXVTRAhBU 1K9OuKgqGrLnaZDeDCcNbC2j3L/pmTPEpd9sH85RM32gbNPoIzPUVn0xI8FHt1/yUE6p PcNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=pWxAn3Ebmh1/8gvbNzGtDlZBYNIXHXwJehkWsHzQpiM=; b=Z1/mL5v+QL0kVYt5NIRiATBqH8yowkB9Y6Di0J184fmmoc8Hy2FHRnhoHL5P0HAO6X YkRQIrcjDmTAtEiS/3HdFZiC7mcg4B9IhD+byF6ivg8cL/WYsOWNRLuwIOi/96zFFCbC cRr0pohpaIIZGoB0omjNV6zk0odgIwmBjhzEuy++42gzuFP45FVzot/1mGlgEtuT9KbN pK/vvQ/qICcpEfHPoL85Mubs3MLjNvhSW26z9YwwSHq9takXfyU4K3ROduCwzVtPVOEs 3YF0XQIkS1NDwMsHLWyCFlgUHtPUm4YSwgNzPx3PkrGS6o8tTjtleFwdSNDIUHsUqwnK iM0A== 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 jan.kiszka@siemens.com) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id 74si683412wmu.5.2017.08.01.23.33.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 23:33:34 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of jan.kiszka@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 jan.kiszka@siemens.com) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v726XXcS022073 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 2 Aug 2017 08:33:34 +0200 Received: from md1f2u6c.ww002.siemens.net ([139.22.117.54]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v726XXo6019376; Wed, 2 Aug 2017 08:33:33 +0200 Subject: Re: [PATCH 16/16] recipes-app/hello-bin: add example on how to use dpkg-bin To: "[ext] Henning Schild" , isar-users@googlegroups.com References: <071da159557fdf0987260a0ca20ff1be79cacbed.1501582237.git.henning.schild@siemens.com> From: Jan Kiszka Message-ID: Date: Wed, 2 Aug 2017 08:33:33 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <071da159557fdf0987260a0ca20ff1be79cacbed.1501582237.git.henning.schild@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: FdN91V5PXD8P 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. > +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? > + 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." > + 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. > +} > Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux