From 4125da7763ffc70cc77578c677bb7e5fc7ebaf57 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Tue, 12 Jul 2016 15:54:46 -0700 Subject: bitbake: toaster: attach kernel artifacts to targets The bzImage and modules files were previously attached to a build, rather than to the target which produced them. This meant it was not possible to determine which kernel artifact produced by a build came from which target; which in turn made it difficult to associate existing kernel artifact with targets when those targets didn't produce artifacts (e.g. if the same machine + target combination was built again and didn't produce a bzImage or modules file because those files already existed). By associating kernel artifacts with the target (via a new TargetArtifactFile model), we make it possible to find all the artifacts for a given machine + target combination. Then, in cases where a build is completed but its targets don't produce any artifacts, we can find a previous Target object with the same machine + target and copy its artifacts to the targets for a just-completed build. Note that this doesn't cover SDK artifacts yet, which are still retrieved in toaster.bbclass and show up as "Other artifacts", lumped together for the whole build rather than by target. [YOCTO #8556] (Bitbake rev: 9b151416e428c2565a27d89116439f9a8d578e3d) Signed-off-by: Elliot Smith Signed-off-by: bavery Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/views.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bitbake/lib/toaster/toastergui/views.py') diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index ad85fafb4d..0ec88d9a77 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -31,6 +31,7 @@ from django.shortcuts import render, redirect, get_object_or_404 from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact, CustomImagePackage +from orm.models import TargetArtifactFile from orm.models import BitbakeVersion, CustomImageRecipe from bldcontrol import bbcontroller from django.views.decorators.cache import cache_control @@ -509,6 +510,8 @@ def builddashboard( request, build_id ): targetHasNoImages = True elem[ 'imageFiles' ] = imageFiles elem[ 'targetHasNoImages' ] = targetHasNoImages + elem['target_artifacts'] = t.targetartifactfile_set.all() + targets.append( elem ) ## @@ -2294,6 +2297,10 @@ if True: elif artifact_type == "buildartifact": file_name = BuildArtifact.objects.get(build = build, pk = artifact_id).file_name + elif artifact_type == "targetartifactfile": + target = TargetArtifactFile.objects.get(pk=artifact_id) + file_name = target.file_name + elif artifact_type == "licensemanifest": file_name = Target.objects.get(build = build, pk = artifact_id).license_manifest_path -- cgit v1.2.3-54-g00ecf