From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6464921707679318016 X-Received: by 10.202.67.198 with SMTP id q189mr3067871oia.24.1505315188271; Wed, 13 Sep 2017 08:06:28 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.36.25.78 with SMTP id b75ls3304305itb.4.canary-gmail; Wed, 13 Sep 2017 08:06:27 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDGtLJ7xTGVAT2ATcNakFBUy8nYMMeQVDlxGem08+hn8aI8ayQ6hJypVIAklprHqA7ZU83u X-Received: by 10.31.235.129 with SMTP id j123mr9588013vkh.110.1505315187860; Wed, 13 Sep 2017 08:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505315187; cv=none; d=google.com; s=arc-20160816; b=QVRsaRKg2KcccjLocAG5Q21l3ryo1NAMvxcaLMXEXGF5tH6/PfX2441BMEyIOGxfZ/ qLSgq1U/7SJYOrMEeBC+3a7NYeNqgICvY0b8Bwg6J+dvfWso8r8Sgi39+iFdp5kRebKO Jcp22Zvwx/liTDQbAhHEaZmHtWlWSRRnjQ8RxeBSMJqcbzcvxeWl5KJdLhePSsKzTIk/ dUhYVT4IpDRzNA9UR414oZNvB8lAaLGG/PlmFmxVmgngO/2lmtpwr8JqgRTINvz6kwzc 4530QCT2Y/vo4V7NM9BDsuumHmqqnCFFlCmiet4tbl+e4YgWL458ocR3jiumKYpZYpDq cc6Q== 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:cc:to:subject :arc-authentication-results; bh=k7xbaFpNuMTUcB8TSev+94vRN073jBpOftWqD5inyFU=; b=fAA9t1RTHnlsuNRdtZ/tCYelbUZ6lmbtFQV5SiU61G4ORZDxUHDMvb81jjJv9rWVWf zHGBThToE7uNsacIqmaxbBfEBcZzMU0OSZJEYb3JObSG22Rkn2Is1Wx3gmWdBXg0CD3H 9BnZviMNWpEwRawiKwsjlD3HHrEhqws39umCfdz0Jew4wOfKrz7CstYdkwykjU7lyxA5 PXSqMGPa1a1sB//y2YtPidmyA1oI4GM1Vg5IoxNx+fRkkkUwRX/NabT9y83YO4jy4qsq /58LAQKa0Vq81l+qKqRi4pngJzqh/RLXBBVYZ82O2MKqqc9nbUKpGm5atRBN5Ttz+/Cd txuA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id u15si35445ite.2.2017.09.13.08.06.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 08:06:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id v8DF6LNi012286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 13 Sep 2017 17:06:23 +0200 Subject: Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw To: Henning Schild Cc: isar-users@googlegroups.com, Claudius Heine References: <20170912155810.9434-1-henning.schild@siemens.com> <20170912155810.9434-7-henning.schild@siemens.com> <2de4ef16-3905-ffdc-d59b-cf5d2512cd79@ilbers.de> <20170913161514.4fc6199d@md1em3qc> From: Alexander Smirnov Message-ID: <94cfae71-9d0d-3c32-b939-11a99cc3a969@ilbers.de> Date: Wed, 13 Sep 2017 18:06:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170913161514.4fc6199d@md1em3qc> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: ArwHIitFqTSE On 09/13/2017 05:15 PM, Henning Schild wrote: > Am Wed, 13 Sep 2017 16:13:42 +0300 > schrieb Alexander Smirnov : > >> On 09/12/2017 06:58 PM, Henning Schild wrote: >>> Issue: >>> It might not be clear to a user how to make use of the class >>> dpkg-raw. >>> >>> 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. >>> >> >> I'd like to ask for another extra patch which adds example-raw to >> default IMAGE_INSTALL in "meta-isar/conf/local.conf.sample" for easy >> testing. Now for testing I have to add it manually. > > See, i do that in my layer ;). But if you think the example should be > part of the default image i can prepare such a patch. There is the default build instructions in ./README.md -> doc/user_manual.md, so it would be nice if all the Isar features and examples will be included to this build. > >> Again this could be done later in next series. > > Ok, waiting for feedback. As I said, let's keep this series as it is. Alex > > Henning > >> Alex >> >>> Signed-off-by: Henning Schild >>> --- >>> .../recipes-app/example-raw/example-raw_0.1.bb | 35 >>> ++++++++++++++++++++++ >>> meta-isar/recipes-app/example-raw/files/README | 1 + >>> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++ >>> 3 files changed, 52 insertions(+) create mode 100644 >>> meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode >>> 100644 meta-isar/recipes-app/example-raw/files/README create mode >>> 100644 meta-isar/recipes-app/example-raw/files/postinst >>> >>> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb >>> b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb new file >>> mode 100644 index 0000000..d548465 >>> --- /dev/null >>> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb >>> @@ -0,0 +1,35 @@ >>> +# Sample application using dpkg-raw, 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-raw >>> + >>> +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-raw/files/README >>> b/meta-isar/recipes-app/example-raw/files/README new file mode >>> 100644 index 0000000..6e2ce0f >>> --- /dev/null >>> +++ b/meta-isar/recipes-app/example-raw/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-raw/files/postinst >>> b/meta-isar/recipes-app/example-raw/files/postinst new file mode >>> 100644 index 0000000..a28afa3 >>> --- /dev/null >>> +++ b/meta-isar/recipes-app/example-raw/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 >>> >> > -- With best regards, Alexander Smirnov ilbers GmbH Baierbrunner Str. 28c D-81379 Munich +49 (89) 122 67 24-0 http://ilbers.de/ Commercial register Munich, HRB 214197 General manager: Baurzhan Ismagulov