diff options
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 29 |
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): | |||
240 | conf.write('BBPATH .= ":${LAYERDIR}"\nBBFILES += "${LAYERDIR}/recipes/*.bb"\n') | 240 | conf.write('BBPATH .= ":${LAYERDIR}"\nBBFILES += "${LAYERDIR}/recipes/*.bb"\n') |
241 | 241 | ||
242 | # create recipe | 242 | # create recipe |
243 | recipe = os.path.join(layerpath, "recipes", "%s.bb" % target.target) | 243 | recipe_path = \ |
244 | with open(recipe, "w") as recipef: | 244 | os.path.join(layerpath, "recipes", "%s.bb" % target.target) |
245 | recipef.write("require %s\n" % customrecipe.base_recipe.file_path) | 245 | with open(recipe_path, "w") as recipef: |
246 | packages = [pkg.name for pkg in customrecipe.packages.all()] | 246 | recipef.write(customrecipe.generate_recipe_file_contents()) |
247 | if packages: | 247 | |
248 | recipef.write('IMAGE_INSTALL = "%s"\n' % ' '.join(packages)) | 248 | # Update the layer and recipe objects |
249 | customrecipe.layer_version.dirpath = layerpath | ||
250 | customrecipe.layer_version.save() | ||
251 | |||
252 | customrecipe.file_path = recipe_path | ||
253 | customrecipe.save() | ||
249 | 254 | ||
250 | # create *Layer* objects needed for build machinery to work | 255 | # create *Layer* objects needed for build machinery to work |
251 | layer = Layer.objects.get_or_create(name="Toaster Custom layer", | 256 | BRLayer.objects.get_or_create(req=target.req, |
252 | summary="Layer for custom recipes", | 257 | name=layer.name, |
253 | vcs_url="file://%s" % layerpath)[0] | 258 | dirpath=layerpath, |
254 | breq = target.req | ||
255 | lver = Layer_Version.objects.get_or_create(project=breq.project, layer=layer, | ||
256 | dirpath=layerpath, build=breq.build)[0] | ||
257 | ProjectLayer.objects.get_or_create(project=breq.project, layercommit=lver, | ||
258 | optional=False) | ||
259 | BRLayer.objects.get_or_create(req=breq, name=layer.name, dirpath=layerpath, | ||
260 | giturl="file://%s" % layerpath) | 259 | giturl="file://%s" % layerpath) |
261 | if os.path.isdir(layerpath): | 260 | if os.path.isdir(layerpath): |
262 | layerlist.append(layerpath) | 261 | layerlist.append(layerpath) |