[OE-core] [PATCH 2/2] deploy.bbclass: Clean DEPLOYDIR before do_deploy
Daniel Klauer
daniel.klauer at gin.de
Wed Aug 28 11:41:31 UTC 2019
It seems convenient for do_deploy to clean up ${DEPLOYDIR} (its output
directory) before running, just like do_install cleans up ${D} before
running. This way we can be sure that a recipe's do_deploy output is not
accidentally contaminated by previously existing files in DEPLOYDIR in
case of incremental builds.
All recipes using deploy.bbclass (grep -r 'inherit .*deploy') in poky,
meta-openembedded and meta-freescale look to me like they either benefit
from this or are at least not affected negatively by it. The only exception
I've noticed was uboot-sign.bbclass, which was however fixed by the
previous patch.
I tested this by running "bitbake virtual/kernel u-boot":
1. on patched, but clean poky source tree
2. after adding "touch ${DEPLOYDIR}/foo-${PN}" to linux-yocto's/u-boot's
do_deploy, to manually trigger an incremental build of do_deploy only.
3. after removing the modifications again.
The foo-${PN} files existed in tmp/deploy/images/qemux86-64 after step 2,
and not anymore after step 3, as expected. Thus the cleandirs still works.
Signed-off-by: Daniel Klauer <daniel.klauer at gin.de>
---
meta/classes/deploy.bbclass | 1 +
meta/classes/kernel.bbclass | 2 --
meta/recipes-core/meta/signing-keys.bb | 2 --
meta/recipes-core/ovmf/ovmf_git.bb | 1 -
4 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/meta/classes/deploy.bbclass b/meta/classes/deploy.bbclass
index 6d52908783..737c26122b 100644
--- a/meta/classes/deploy.bbclass
+++ b/meta/classes/deploy.bbclass
@@ -8,4 +8,5 @@ python do_deploy_setscene () {
}
addtask do_deploy_setscene
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
+do_deploy[cleandirs] = "${DEPLOYDIR}"
do_deploy[stamp-extra-info] = "${MACHINE_ARCH}"
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index bf3674238f..aa339ace7e 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -706,8 +706,6 @@ kernel_do_deploy() {
done
fi
}
-do_deploy[cleandirs] = "${DEPLOYDIR}"
-do_deploy[dirs] = "${DEPLOYDIR} ${B}"
do_deploy[prefuncs] += "package_get_auto_pr"
addtask deploy after do_populate_sysroot do_packagedata
diff --git a/meta/recipes-core/meta/signing-keys.bb b/meta/recipes-core/meta/signing-keys.bb
index 1e1c7e3459..5bab94aa36 100644
--- a/meta/recipes-core/meta/signing-keys.bb
+++ b/meta/recipes-core/meta/signing-keys.bb
@@ -67,8 +67,6 @@ do_deploy () {
fi
}
do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_RPM}"
-# cleandirs should possibly be in deploy.bbclass but we need it
-do_deploy[cleandirs] = "${DEPLOYDIR}"
# clear stamp-extra-info since MACHINE_ARCH is normally put there by
# deploy.bbclass
do_deploy[stamp-extra-info] = ""
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index b569b593fc..2c804381ee 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -223,7 +223,6 @@ do_deploy[depends] += "${DEPLOYDEP}"
do_deploy() {
}
-do_deploy[cleandirs] = "${DEPLOYDIR}"
do_deploy_class-target() {
# For use with "runqemu ovmf".
for i in \
--
2.17.1
More information about the Openembedded-core
mailing list