Skip to contentSkip to conversation

image.bbclass: exclude deploy-${PN}-image-complete from rm_work

PATCH In review [email protected] 2 participants 3 messages Aug 2, 2019 – Aug 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image.bbclass: exclude deploy-${PN}-image-complete from rm_work

From: Ming Liu <[email protected]>

The results in ${IMGDEPLOYDIR} generated by a image task could be used by later image tasks, hence they should be excluded by rm_work. Or else when a image task gets rerun but one of its dependent image task does not, then the results generated by this dependent image task would not be there in ${IMGDEPLOYDIR}.

---
 meta/classes/image.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/image.bbclass +4 -0
index 682858d..d16e285 100644
@@ -84,6 +84,10 @@ PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}"
 
 IMGDEPLOYDIR = "${WORKDIR}/deploy-${PN}-image-complete"
 
+# The results in ${IMGDEPLOYDIR} generated by a image task could be used by
+# later image tasks, hence they should be excluded by rm_work.
+RM_WORK_EXCLUDE_ITEMS += "deploy-${PN}-image-complete"
+
 # Images are generally built explicitly, do not need to be part of world.
 EXCLUDE_FROM_WORLD = "1"
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · On Fri, 2019-08-02 at 17:12 +0800, [email protected] wrote:

From: Ming Liu <[email protected]>

The results in ${IMGDEPLOYDIR} generated by a image task could be used by later image tasks.

No they shouldn't.

Quoted 4 lines

, hence they should be excluded by rm_work. Or else when a image task gets rerun but one of its dependent image task does not, then the results generated by this dependent image task would not be there in ${IMGDEPLOYDIR}.

Nothing should be poking into IMGDEPLOYDIR outside of the image tasks.

do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}" do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"

anything else should be after do_image_complete and be referencing DEPLOY_DIR_IMAGE.

Cheers,

Richard

author
#2 lore raw

Hi, Richard:

This is to handle the case IMAGE_CMD_yyy depending on IMAGE_CMD_xxx, while IMAGE_CMD_yyy need access the result generated by IMAGE_CMD_xxx in ${IMGDEPLOYDIR}, and IMAGE_CMD_yyy itself wanna generate a result in ${IMGDEPLOYDIR} as well, to be able to be covered by sstate.

In this case, IMAGE_CMD_yyy should not get the IMAGE_CMD_xxx's result from ${DEPLOY_DIR_IMAGE} because that might not be generated by the latest bitbake run.

And the result of IMAGE_CMD_xxx might not exit in ${IMGDEPLOYDIR} when rm_work is chosen in the following scenario:

1 bitbake image (IMAGE_CMD_xxx and IMAGE_CMD_yyy both run at the first time) 2 Change some code in IMAGE_CMD_yyy, but do not touch IMAGE_CMD_xxx 3 bitbake image

in the step 3, the result generated by IMAGE_CMD_xxx would not be in ${IMGDEPLOYDIR} if rm_work is chosen (Because it's removed in step 1), so this patch mainly aims to fix this problem.

//Ming Liu

Quoted 25 lines · On Fri, 2019-08-02 at 17:12 +0800, [email protected] wrote:
Quoted 4 lines

From: Ming Liu <[email protected]>

The results in ${IMGDEPLOYDIR} generated by a image task could be used by later image tasks.

No they shouldn't.

Quoted 4 lines

, hence they should be excluded by rm_work. Or else when a image task gets rerun but one of its dependent image task does not, then the results generated by this dependent image task would not be there in ${IMGDEPLOYDIR}.

Nothing should be poking into IMGDEPLOYDIR outside of the image tasks.

do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}" do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"

anything else should be after do_image_complete and be referencing DEPLOY_DIR_IMAGE.

Cheers,

Richard