From 30a9f65dcc043c1f51fd3128653ea5ecef8e25a0 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 24 Nov 2016 11:20:00 +0000 Subject: bitbake: toaster: buildinfohelper toaster-custom-images layer This fixes the unidentified layers issue by making the toaster-custom-images layer a local layer. By doing this we also fix the git assumptions made for the local layers which stop recipes and other meta data being associated with them. This also removed some of the special casing previously needed when we didn't have the concept of a local (non git) layer. Also rename created flag var to a have a different var for each returned value so that the same value isn't used multiple times. [YOCTO #10220] (Bitbake rev: ba5332d4960d7f4f79aef63136796e2fa67284e3) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- .../toaster/bldcontrol/localhostbecontroller.py | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py') diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index 11335ac393..18870d9612 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py @@ -228,13 +228,22 @@ class LocalhostBEController(BuildEnvironmentController): br_layer_base_recipe = layers.get( layer_version=customrecipe.base_recipe.layer_version) - br_layer_base_dirpath = \ - os.path.join(self.be.sourcedir, - self.getGitCloneDirectory( - br_layer_base_recipe.giturl, - br_layer_base_recipe.commit), - customrecipe.base_recipe.layer_version.dirpath - ) + # If the layer is one that we've cloned we know where it lives + if br_layer_base_recipe.giturl and br_layer_base_recipe.commit: + layer_path = self.getGitCloneDirectory( + br_layer_base_recipe.giturl, + br_layer_base_recipe.commit) + # Otherwise it's a local layer + elif br_layer_base_recipe.local_source_dir: + layer_path = br_layer_base_recipe.local_source_dir + else: + logger.error("Unable to workout the dir path for the custom" + " image recipe") + + br_layer_base_dirpath = os.path.join( + self.be.sourcedir, + layer_path, + customrecipe.base_recipe.layer_version.dirpath) customrecipe.base_recipe.layer_version.dirpath = \ br_layer_base_dirpath @@ -249,6 +258,8 @@ class LocalhostBEController(BuildEnvironmentController): # Update the layer and recipe objects customrecipe.layer_version.dirpath = layerpath + customrecipe.layer_version.layer.local_source_dir = layerpath + customrecipe.layer_version.layer.save() customrecipe.layer_version.save() customrecipe.file_path = recipe_path -- cgit v1.2.3-54-g00ecf