summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-08 17:52:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-10 11:44:58 +0000
commiteda0ed901532ceb55bcf24bbde2c40a0d8759b69 (patch)
tree024df50c614e657ecded4b81142e32c5d782409b /bitbake/lib
parentd07473d2c25ca116c1b16018d7c3d9bbd3a721bb (diff)
downloadast2050-yocto-poky-eda0ed901532ceb55bcf24bbde2c40a0d8759b69.zip
ast2050-yocto-poky-eda0ed901532ceb55bcf24bbde2c40a0d8759b69.tar.gz
cooker.py: Ensure only one copy of bitbake executes at once
The bitbake codebase makes assumptions that only one copy is active against a given build directory at a given time. This patch adds a lockfile in TOPDIR to ensure that is the case. Note that no unlock is needed, that is automatically dropped when execution terminates. (Bitbake rev: 6004cbf36c980c2574c1c9153df81a7c55317e17) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/cooker.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 9537239..4f01cc1 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -138,6 +138,13 @@ class BBCooker:
if not self.configuration.cmd:
self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build"
+ # Take a lock so only one copy of bitbake can run against a given build
+ # directory at a time
+ lockfile = bb.data.expand("${TOPDIR}/bitbake.lock", self.configuration.data)
+ self.lock = bb.utils.lockfile(lockfile, False, False)
+ if not self.lock:
+ bb.fatal("Only one copy of bitbake should be run against a build directory")
+
bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True)
if bbpkgs and len(self.configuration.pkgs_to_build) == 0:
self.configuration.pkgs_to_build.extend(bbpkgs.split())
OpenPOWER on IntegriCloud