From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6464921707679318016 X-Received: by 10.28.142.201 with SMTP id q192mr1893wmd.23.1505231882824; Tue, 12 Sep 2017 08:58:02 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.69.66 with SMTP id s63ls134254lja.50.gmail; Tue, 12 Sep 2017 08:58:02 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCTeTc3whS8QDq+G8LdKnlda6vfOSVNPLvDj0n1LOBCiWYXdIjaoeU8zHW9a4ibA44eot8u X-Received: by 10.25.40.20 with SMTP id o20mr1261179lfo.41.1505231882522; Tue, 12 Sep 2017 08:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505231882; cv=none; d=google.com; s=arc-20160816; b=egtaYPtQ/xaLMixDfHMgbQ7q1B+ffI8sumSa13/EOvwdocEp6Xu+QZD0i4UC353dE2 4i8rsYxwmI9oFJRcYMADKb2YzUoJZWOgDExeP7Cnzh9pta2gCR3/EtnQ0YRZS9S8FxKC wE7xY/S9d17jV0oNiqjzFbRy3SWP5TieUwE4EjT6dUugZj7CsEzujE6/EE06KmRFELre tMM6uGOl+DsKQcy7X/FINW8Pt4+tbVjobPtZUxYyCarjEnfqML7mQgid63opnsgWBMoi 3qWNAUkF0YFFBpKsrIeVXICmjXfNzN5jsrfGkgUkL7Ct2iHOiJrife7g4uB1e+SXgDM5 sdAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3LnCOLJPKETh4oyJZpEoXW1ENTY2LhVuUWvDdvr4bIk=; b=wyhQrGzfrZa9w37cgzcF/M39qDIyVIPRuHtkNvsSpPbSodjPU0v5BVq/m8Qi5Mp61x sopo7L1V1W7LP17B/MtPQvrVPy5JR0aVSgestScHu3NlyI1nxnnpPnHlGVTPvTXwxLL2 GCNvd6LUimVjJ0hKmyGPGWfFQb+xz8AoMNCWZnsX28xnUTe0R1x48z+J7d7n3iSRfjr1 sKxiPq1/AwiUa9g1wwqF0A3vpD1074slbYCA5VUQ5gznozlGrfVRRQqiBdR5Yn8HHOBw INdWRnlBiiJhLG9w9DeQ8r+VBZW+lZbbNkgsQTvke1R6CFC5o/yyG0vwnmeDQ37V9qDU Zkzw== 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 v184si221211wmf.9.2017.09.12.08.58.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 08:58:02 -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 mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v8CFw1kp011590 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Sep 2017 17:58:01 +0200 Received: from md1em3qc.ww002.siemens.net ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v8CFw19N001102; Tue, 12 Sep 2017 17:58:01 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Alexander Smirnov , Henning Schild , Claudius Heine Subject: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw Date: Tue, 12 Sep 2017 17:58:10 +0200 Message-Id: <20170912155810.9434-7-henning.schild@siemens.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170912155810.9434-1-henning.schild@siemens.com> References: <20170912155810.9434-1-henning.schild@siemens.com> X-TUID: dXR1FJd03FnV 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. 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 -- 2.13.5