Patchwork [3/4] classes/populate_sdk_base: fix race condition with do_rootfs

login
register
mail settings
Submitter Paul Eggleton
Date Feb. 17, 2014, 2:22 p.m.
Message ID <847cee60c8a619044eb8cab9e28fed8275282c8e.1392646768.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/66847/
State Accepted
Commit 77a53c5a2a947b6515d4188e37ed823a2602ff83
Headers show

Comments

Paul Eggleton - Feb. 17, 2014, 2:22 p.m.
do_rootfs has ${S} in cleandirs, and during do_populate_sdk we call
exec_func() several times, which by default uses ${B} as the working
directory. If do_populate_sysroot and do_rootfs race against eachother,
the directory may not exist at the exact instant that the setup code
for do_populate_sdk tries to cd into it. We don't actually use ${B}
for do_populate_sysroot so we can set it to something else just for that
task to avoid the race.

NOTE: because this task name contains an underscore, the override will
not work; the BitBake patch that changes these to hyphens for the
task override is required for this patch to work (but won't break things
without it.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/populate_sdk_base.bbclass | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index ee2a7c1..e2e013a 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -26,6 +26,8 @@  SDK_DIR = "${WORKDIR}/sdk"
 SDK_OUTPUT = "${SDK_DIR}/image"
 SDK_DEPLOY = "${TMPDIR}/deploy/sdk"
 
+B_task-populate-sdk = "${SDK_DIR}"
+
 SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
 
 TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host packagegroup-cross-canadian-${MACHINE}"