From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6449247988281769984 X-Received: by 10.46.81.17 with SMTP id f17mr2258427ljb.14.1501582561048; Tue, 01 Aug 2017 03:16:01 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.25.190.210 with SMTP id o201ls137630lff.52.gmail; Tue, 01 Aug 2017 03:16:00 -0700 (PDT) X-Received: by 10.46.74.1 with SMTP id x1mr134937lja.24.1501582560739; Tue, 01 Aug 2017 03:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501582560; cv=none; d=google.com; s=arc-20160816; b=Y/G+vbWhD7TCUGKo8NeXZs3IIeBZjDmFmxYpDR7FBBJO9qmMWl0NonmfZcCOMnZJ8x KDfrI/PxaIJzXL8vQQZ2A9g3QmRRrnSzso4HS2fpElQOM13AyBM/Lr78ZZZ3TkiO87yi kYKuvG7bhvDR8/Mil8AEc+DPHjJqIOME8AYRuYcirxSe2Ny5vVajVW81TA6KYEafB4wH POrv4LBJUBKk7ftMDR9qFVo5e7AjnpM53CWyCH05Lups8IODTVZHO01/As1oSBiuu/wC XlHEKEsoJy5svX+CpZgrCZ/B8HjNKBnvya2GmmVG02aSC0Zk9udP0YyxEGfIf8nTMFJ/ L0jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=415zAHYY6USciSaUL3KWVeSZJi7xq4wVFMx99Ge/o4g=; b=Pk0kx8Un16Q+hq5AHLP0Km9pvhuIjsWg+KSzDUBtTUhwF7+B3AGOscaGyRieg2345s eGYO6gFfKHkDkmdixj+lyT3jr1zjK8PWAXHNzYZ7242Rzq7/cMsvvIKa+LqDNi1wM24/ B/M56VEtqPEoGdArlL3xBFR64Rw5XR6HfbIKLKvvKmlRP6lrOonQi9HRZ8lzGIcib9Jc by41mi4lK4eDvGsej7HKjQbCrlq/K5N2az6fqXwwszTwUBpClopW1SVzTqnitczv0c5i 5iwB+n29z6h9fTjWxH7V35oXIVccwhi0AfJuQ9FoQY/fPO3qsAIi19Cpx5XAFMu9YrZo qsEw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.28 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 goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id n5si72708wme.5.2017.08.01.03.16.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 03:16:00 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.28 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.28 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 goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id v71AG0MF010928 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 1 Aug 2017 12:16:00 +0200 Received: from md1em3qc.ww002.siemens.net ([139.25.68.40]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id v71AFx6B016179; Tue, 1 Aug 2017 12:16:00 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Henning Schild Subject: [PATCH 16/16] recipes-app/hello-bin: add example on how to use dpkg-bin Date: Tue, 1 Aug 2017 12:17:34 +0200 Message-Id: <071da159557fdf0987260a0ca20ff1be79cacbed.1501582237.git.henning.schild@siemens.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: X-TUID: 1fdLfU7QIMjc 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 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 + +do_install() { + bbnote "Creating ${PN} binary" + echo "#!/bin/sh" > ${WORKDIR}/${PN} + echo "echo Hello World! ${PN}_${PV}" >> ${WORKDIR}/${PN} + + bbnote "Putting ${PN} into overlay" + 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" + 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 +} -- 2.13.0