mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 09:32:13 +02:00
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>
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user