public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH v2 1/9] dpkg-raw: Install hooks automatically
Date: Tue, 13 Feb 2018 21:05:19 +0100	[thread overview]
Message-ID: <9aa55fd92f18b20e4d325a46de8dd9e177f4a16c.1518552327.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1518552327.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1518552327.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

Simplify the process of adding a pre/postinst or -rm script to a
dpkg-raw package by auto-installing all files of that name from the
WORKDIR.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/recipes-app/example-raw/example-raw_0.2.bb | 8 --------
 meta-isar/recipes-app/example-raw/files/postinst     | 4 ++++
 meta/classes/dpkg-raw.bbclass                        | 5 ++++-
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.2.bb b/meta-isar/recipes-app/example-raw/example-raw_0.2.bb
index 657430e..9200e0d 100644
--- a/meta-isar/recipes-app/example-raw/example-raw_0.2.bb
+++ b/meta-isar/recipes-app/example-raw/example-raw_0.2.bb
@@ -25,14 +25,6 @@ do_install() {
 	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
-
-	# this wins over meta-isar/recipes-core/images/files/*configscript.sh
-	# but we take the same password for this example
-	bbnote "Set the root password"
-	echo 'echo "root:root" | chpasswd' >> ${D}/DEBIAN/postinst
-
 	bbnote "Now for a fake config file"
 	echo "# empty config file" > ${WORKDIR}/${PN}.conf
 	install -v -d ${D}/usr/local/etc/
diff --git a/meta-isar/recipes-app/example-raw/files/postinst b/meta-isar/recipes-app/example-raw/files/postinst
index a28afa3..b82fccd 100644
--- a/meta-isar/recipes-app/example-raw/files/postinst
+++ b/meta-isar/recipes-app/example-raw/files/postinst
@@ -14,3 +14,7 @@ if ! getent passwd isar >/dev/null; then
 fi
 
 chown -R isar:isar /var/lib/isar
+
+# this wins over meta-isar/recipes-core/images/files/*configscript.sh
+# but we take the same password for this example
+echo "root:root" | chpasswd
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index d132066..44aa078 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -35,7 +35,10 @@ do_deb_package_prepare() {
 	do
 		for a in inst rm
 		do
-			chmod -f +x ${D}/DEBIAN/${t}${a} || true
+			if [ -f ${WORKDIR}/${t}${a} ]; then
+				install -v -m 755 ${WORKDIR}/${t}${a} \
+					${D}/DEBIAN/${t}${a}
+			fi
 		done
 	done
 }
-- 
2.13.6


  reply	other threads:[~2018-02-13 20:05 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 20:05 [PATCH v2 0/9] Add support for automatic partial rebuilds on recipe changes Jan Kiszka
2018-02-13 20:05 ` Jan Kiszka [this message]
2018-02-13 20:05 ` [PATCH v2 2/9] Fix indention of base_do_build Jan Kiszka
2018-02-13 20:05 ` [PATCH v2 3/9] Add clean and cleanall tasks Jan Kiszka
2018-02-14 15:14   ` [PATCH v3 " Jan Kiszka
2018-02-13 20:05 ` [PATCH v2 4/9] Enable recipe caching Jan Kiszka
2018-02-13 20:05 ` [PATCH v2 5/9] Move buildchroot mounts into dpkg-base class Jan Kiszka
2018-02-13 20:17   ` Alexander Smirnov
2018-02-13 20:47     ` Jan Kiszka
2018-02-14  5:54       ` Alexander Smirnov
2018-02-14  8:37         ` Jan Kiszka
2018-02-14  8:52   ` [PATCH v3 " Jan Kiszka
2018-02-14  9:09     ` Alexander Smirnov
2018-02-14  9:16       ` Jan Kiszka
2018-02-13 20:05 ` [PATCH v2 6/9] Enable proper rebuilds on dependency changes Jan Kiszka
2018-02-13 20:05 ` [PATCH v2 7/9] dpkg-raw: Clean DEBIAN dir prior to filling it Jan Kiszka
2018-02-15  9:14   ` Claudius Heine
2018-02-15  9:18     ` Jan Kiszka
2018-02-15 10:26       ` Claudius Heine
2018-02-15 10:30         ` Alexander Smirnov
2018-02-15 10:53           ` [PATCH] dpkg-raw: Fix creation of DEBIAN folder Jan Kiszka
2018-02-15 15:39             ` Alexander Smirnov
2018-02-26 11:39             ` Andreas Reichel
2018-02-26 12:03               ` Jan Kiszka
2018-02-26 12:27               ` Andreas Reichel
2018-02-15 12:20           ` [PATCH v2 7/9] dpkg-raw: Clean DEBIAN dir prior to filling it Claudius Heine
2018-02-13 20:05 ` [PATCH v2 8/9] isar-image-base: Clean rootfs folder prior to building Jan Kiszka
2018-02-13 20:05 ` [PATCH v2 9/9] buildchroot: Clean up rootfs prior to populating it Jan Kiszka
2018-02-14 17:43   ` Alexander Smirnov
2018-02-14 17:48     ` Jan Kiszka
2018-02-14 11:33 ` [PATCH v2 0/9] Add support for automatic partial rebuilds on recipe changes Alexander Smirnov
2018-02-14 12:41   ` Jan Kiszka
2018-02-14 12:57     ` Alexander Smirnov
2018-02-14 13:10       ` Jan Kiszka
2018-02-14 13:29         ` Jan Kiszka
2018-02-14 13:38           ` Jan Kiszka
2018-02-14 13:49             ` Jan Kiszka
2018-02-14 14:06               ` Alexander Smirnov
2018-02-14 14:03             ` Alexander Smirnov
2018-02-14 14:10               ` Jan Kiszka
2018-02-14 17:51 ` Alexander Smirnov
2018-02-14 17:54   ` Jan Kiszka
2018-02-14 17:57     ` Alexander Smirnov
2018-02-14 18:02       ` Jan Kiszka
2018-02-14 18:34         ` Alexander Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9aa55fd92f18b20e4d325a46de8dd9e177f4a16c.1518552327.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox