From: Alexander Smirnov <asmirnov@ilbers.de>
To: isar-users@googlegroups.com
Cc: Alexander Smirnov <asmirnov@ilbers.de>
Subject: [PATCH v3 5/5] class/dpkg: Unify workplace for packages
Date: Mon, 11 Sep 2017 22:27:38 +0300 [thread overview]
Message-ID: <20170911192738.1323-6-asmirnov@ilbers.de> (raw)
In-Reply-To: <20170911192738.1323-1-asmirnov@ilbers.de>
Get rid of splitting package's data between WORKDIR and BUILDCHROOT.
Now everything is stored into WORKDIR, and BUILDCHROOT is used for
compilation only.
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
meta/classes/dpkg.bbclass | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 360a95c..16b7fc5 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -3,12 +3,11 @@
# Add dependency from buildchroot creation
DEPENDS += "buildchroot"
-do_unpack[deptask] = "do_build"
+do_build[deptask] = "do_build"
# Each package should have its own unique build folder, so use
# recipe name as identifier
PP = "/home/builder/${PN}"
-BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
do_fetch[dirs] = "${DL_DIR}"
@@ -27,17 +26,16 @@ python do_fetch() {
addtask fetch before do_unpack
-do_unpack[dirs] = "${BUILDROOT}"
+do_unpack[dirs] = "${WORKDIR}"
do_unpack[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-S ?= "${BUILDROOT}"
-# Unpack package and put it into working directory in buildchroot
+# Unpack package and put it into working directory
python do_unpack() {
src_uri = (d.getVar('SRC_URI', True) or "").split()
if len(src_uri) == 0:
return
- rootdir = d.getVar('BUILDROOT', True)
+ rootdir = d.getVar('WORKDIR', True)
try:
fetcher = bb.fetch2.Fetch(src_uri, d)
@@ -48,17 +46,22 @@ python do_unpack() {
addtask unpack after do_fetch before do_build
+BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
# Build package from sources using build script
do_build() {
+ mkdir -p ${BUILDROOT}
+ sudo mount --bind ${WORKDIR} ${BUILDROOT}
sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
+ sudo umount ${BUILDROOT}
+ rm -rf ${BUILDROOT}
}
# Install package to dedicated deploy directory
do_install() {
- install -m 644 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
+ install -m 644 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
}
addtask install after do_build
--
2.1.4
next prev parent reply other threads:[~2017-09-11 19:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 19:27 [PATCH v3 0/5] Unify work space " Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 1/5] image: Unify path to image rootfs Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 2/5] isar: Change build folders tree Alexander Smirnov
2017-09-12 7:23 ` Claudius Heine
2017-09-12 7:57 ` Alexander Smirnov
2017-09-12 12:52 ` Henning Schild
2017-09-12 13:02 ` Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 3/5] stamps: Name stamps canonicaly and unified Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 4/5] image: Name image " Alexander Smirnov
2017-09-11 19:27 ` Alexander Smirnov [this message]
2017-09-12 14:26 ` [PATCH] doc: Update technical overview 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=20170911192738.1323-6-asmirnov@ilbers.de \
--to=asmirnov@ilbers.de \
--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