aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-11-04 15:02:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:17 +0000
commit2cf55afb9714827401500c631d95d0fc3a10efdd (patch)
tree0bc5ea6ae3a357023011269bd1605eacb4bc7908 /bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
parentc402ac2654cafb2c594c091a5a0a0f340af19a05 (diff)
downloadopenembedded-core-contrib-2cf55afb9714827401500c631d95d0fc3a10efdd.tar.gz
bitbake: toaster: move CustomImageRecipe generation to API entry point
Use the CustomImageRecipe generate_recipe_file_contents to generate the recipe that we build from. Move creation of the dummy layer and recipe object to the point of recipe creation as we need these objects before the build time. Also update the methods to add and remove packages to account for the CustomImageRecipe inheriting from Recipe. (Bitbake rev: f3322567378d6038a00da0fab6c5641a1a8e5409) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 2dd48d454a..8acf013476 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -240,23 +240,22 @@ class LocalhostBEController(BuildEnvironmentController):
conf.write('BBPATH .= ":${LAYERDIR}"\nBBFILES += "${LAYERDIR}/recipes/*.bb"\n')
# create recipe
- recipe = os.path.join(layerpath, "recipes", "%s.bb" % target.target)
- with open(recipe, "w") as recipef:
- recipef.write("require %s\n" % customrecipe.base_recipe.file_path)
- packages = [pkg.name for pkg in customrecipe.packages.all()]
- if packages:
- recipef.write('IMAGE_INSTALL = "%s"\n' % ' '.join(packages))
+ recipe_path = \
+ os.path.join(layerpath, "recipes", "%s.bb" % target.target)
+ with open(recipe_path, "w") as recipef:
+ recipef.write(customrecipe.generate_recipe_file_contents())
+
+ # Update the layer and recipe objects
+ customrecipe.layer_version.dirpath = layerpath
+ customrecipe.layer_version.save()
+
+ customrecipe.file_path = recipe_path
+ customrecipe.save()
# create *Layer* objects needed for build machinery to work
- layer = Layer.objects.get_or_create(name="Toaster Custom layer",
- summary="Layer for custom recipes",
- vcs_url="file://%s" % layerpath)[0]
- breq = target.req
- lver = Layer_Version.objects.get_or_create(project=breq.project, layer=layer,
- dirpath=layerpath, build=breq.build)[0]
- ProjectLayer.objects.get_or_create(project=breq.project, layercommit=lver,
- optional=False)
- BRLayer.objects.get_or_create(req=breq, name=layer.name, dirpath=layerpath,
+ BRLayer.objects.get_or_create(req=target.req,
+ name=layer.name,
+ dirpath=layerpath,
giturl="file://%s" % layerpath)
if os.path.isdir(layerpath):
layerlist.append(layerpath)