summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2018-09-05 22:26:40 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-10 12:15:04 +0100
commite44bb5b5c8c20af0a87f9c2498c391f764195c32 (patch)
tree4eb66d1b3eec82f1cbc09b21a7218e84a2c936b4 /bitbake
parent45ef387cc54a0584807e05a952e1e4681ec4c664 (diff)
downloadpoky-e44bb5b5c8c20af0a87f9c2498c391f764195c32.tar.gz
bitbake: toaster: allow pokydirname to be evaluated when all layers are local
Toaster depends on pokydirname for identifying the location of the oe-init-build-env script (and there might be other purposes in the future). The problem with current approach is that it only checks/sets the variable with git based repos, whereas toaster provides mechanisms to allow having layers that are all locally available. The evaluation of the variable fails in such scenarios, so use a more flexible mechanism in this case and try to locate poky in the local layers as well, if not already set. [YOCTO #12891] (Bitbake rev: 971c728075af05e71edfd8e5212728c3dd0787b6) Signed-off-by: Awais Belal <awais.belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 16c7c80441..f960a389c4 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -217,9 +217,21 @@ class LocalhostBEController(BuildEnvironmentController):
217 self.setCloneStatus(bitbake,'complete',clone_total,clone_count) 217 self.setCloneStatus(bitbake,'complete',clone_total,clone_count)
218 logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist)) 218 logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
219 219
220 if self.pokydirname is None and os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")): 220 # Resolve self.pokydirname if not resolved yet, consider the scenario
221 logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir) 221 # where all layers are local, that's the else clause
222 self.pokydirname = self.be.sourcedir 222 if self.pokydirname is None:
223 if os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")):
224 logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir)
225 self.pokydirname = self.be.sourcedir
226 else:
227 # Alternatively, scan local layers for relative "oe-init-build-env" location
228 for layer in layers:
229 if os.path.exists(os.path.join(layer.layer_version.layer.local_source_dir,"..","oe-init-build-env")):
230 logger.debug("localhostbecontroller, setting pokydirname to %s" % (layer.layer_version.layer.local_source_dir))
231 self.pokydirname = os.path.join(layer.layer_version.layer.local_source_dir,"..")
232 break
233 else:
234 logger.error("pokydirname is not set, you will run into trouble!")
223 235
224 # 5. create custom layer and add custom recipes to it 236 # 5. create custom layer and add custom recipes to it
225 for target in targets: 237 for target in targets: