From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Khem Raj <raj.khem@gmail.com>,
Richard Purdie <richard.purdie@linuxfoundation.org>,
Armin Kuster <akuster808@gmail.com>,
Jerome Neanne <jneanne@baylibre.com>,
Quentin Schulz <quentin.schulz@streamunlimited.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
openembedded-core@lists.openembedded.org
Subject: [RFC PATCH 1/2] image.bbclass: add an intermediate deploy task
Date: Thu, 19 Mar 2020 17:44:02 +0100 [thread overview]
Message-ID: <20200319164403.29605-2-brgl@bgdev.pl> (raw)
In-Reply-To: <20200319164403.29605-1-brgl@bgdev.pl>
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Instead of using do_image_complete for both the deployment of image
artifacts into DEPLOY_DIR_IMAGE as well as calling the image
post-process commands, split the responsability between two separate
tasks: do_image_deploy will take care of the sstate deployment, while
do_image_complete will only do the post-processing. This way we can
make the dependencies more fine-grained.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
meta/classes/image.bbclass | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 07aa1f1fa5..6e2b864f73 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -144,7 +144,7 @@ python () {
deps += " %s:%s" % (dep, task)
return deps
- d.appendVarFlag('do_image_complete', 'depends', extraimage_getdepends('do_populate_sysroot'))
+ d.appendVarFlag('do_image_deploy', 'depends', extraimage_getdepends('do_populate_sysroot'))
deps = " " + imagetypes_getdepends(d)
d.appendVarFlag('do_rootfs', 'depends', deps)
@@ -264,6 +264,17 @@ do_image[dirs] = "${TOPDIR}"
do_image[umask] = "022"
addtask do_image after do_rootfs
+do_image_deploy() {
+ # This is a placeholder really but it still needs to run for sstate
+ # to correctly deploy the image artifacts.
+ true
+}
+SSTATETASKS += "do_image_deploy"
+do_image_deploy[sstate-inputdirs] = "${IMGDEPLOYDIR}"
+do_image_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
+SSTATE_SKIP_CREATION_task-image-deploy = '1'
+addtask do_image_deploy after do_image before do_build
+
fakeroot python do_image_complete () {
from oe.utils import execute_pre_post_process
@@ -273,12 +284,8 @@ fakeroot python do_image_complete () {
}
do_image_complete[dirs] = "${TOPDIR}"
do_image_complete[umask] = "022"
-SSTATETASKS += "do_image_complete"
-SSTATE_SKIP_CREATION_task-image-complete = '1'
-do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}"
-do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
do_image_complete[stamp-extra-info] = "${MACHINE_ARCH}"
-addtask do_image_complete after do_image before do_build
+addtask do_image_complete after do_image_deploy before do_build
python do_image_complete_setscene () {
sstate_setscene(d)
}
@@ -500,8 +507,8 @@ python () {
d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
d.appendVarFlag(task, 'vardepsexclude', ' DATETIME DATE ' + ' '.join(vardepsexclude))
- bb.debug(2, "Adding task %s before %s, after %s" % (task, 'do_image_complete', after))
- bb.build.addtask(task, 'do_image_complete', after, d)
+ bb.debug(2, "Adding task %s before do_image_deploy, after %s" % (task, after))
+ bb.build.addtask(task, 'do_image_deploy', after, d)
}
#
--
2.19.1
next prev parent reply other threads:[~2020-03-19 16:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-19 16:44 [RFC PATCH 0/2] image.bbclass: support two-stage deployment of image artifacts Bartosz Golaszewski
2020-03-19 16:44 ` Bartosz Golaszewski [this message]
2020-03-19 16:44 ` [RFC PATCH 2/2] image.bbclass: deploy artifacts in two stages Bartosz Golaszewski
2020-03-19 16:49 ` [RFC PATCH 0/2] image.bbclass: support two-stage deployment of image artifacts Bartosz Golaszewski
2020-03-19 17:12 ` Richard Purdie
2020-03-19 18:20 ` Bartosz Golaszewski
2020-03-19 23:38 ` Richard Purdie
2020-03-20 13:11 ` Bartosz Golaszewski
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=20200319164403.29605-2-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=akuster808@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=jneanne@baylibre.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=quentin.schulz@streamunlimited.com \
--cc=raj.khem@gmail.com \
--cc=richard.purdie@linuxfoundation.org \
/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