diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-07-12 15:54:54 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-19 08:56:45 +0100 |
commit | 79b8e349a0da2ea6b97ad82daa5837e6dfffe0af (patch) | |
tree | e96292cf59806c325064d90ca564436fb929186e /lib | |
parent | b4dce68045c4615e7a6a474e952f670721a3b54e (diff) | |
download | bitbake-contrib-79b8e349a0da2ea6b97ad82daa5837e6dfffe0af.tar.gz |
toaster: add package manifest path to Target objects
Store the path to the *.rootfs.manifest file for targets which
generate images.
A link to the package manifest is displayed in the build dashboard
for targets which produce image files.
Like the license manifest path, if a target would have produced
the package manifest (but didn't, because it already existed), that
path is copied from the target which did produce the package
manifest.
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/ui/buildinfohelper.py | 24 | ||||
-rw-r--r-- | lib/toaster/orm/migrations/0009_target_package_manifest_path.py | 19 | ||||
-rw-r--r-- | lib/toaster/orm/models.py | 8 | ||||
-rw-r--r-- | lib/toaster/toastergui/templates/builddashboard.html | 6 | ||||
-rwxr-xr-x | lib/toaster/toastergui/views.py | 3 |
5 files changed, 54 insertions, 6 deletions
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py index 52b5e12bf..91189f60e 100644 --- a/lib/bb/ui/buildinfohelper.py +++ b/lib/bb/ui/buildinfohelper.py @@ -256,6 +256,10 @@ class ORMWrapper(object): target.license_manifest_path = license_manifest_path target.save() + def update_target_set_package_manifest(self, target, package_manifest_path): + target.package_manifest_path = package_manifest_path + target.save() + def update_task_object(self, build, task_name, recipe_name, task_stats): """ Find the task for build which matches the recipe and task name @@ -1597,7 +1601,7 @@ class BuildInfoHelper(object): machine = self.server.runCommand(['getVariable', 'MACHINE'])[0] image_name = self.server.runCommand(['getVariable', 'IMAGE_NAME'])[0] - # location of the image_license.manifest files for this build; + # location of the manifest files for this build; # note that this file is only produced if an image is produced license_directory = \ self.server.runCommand(['getVariable', 'LICENSE_DIRECTORY'])[0] @@ -1636,6 +1640,11 @@ class BuildInfoHelper(object): real_image_name, 'image_license.manifest') + image_package_manifest_path = os.path.join( + license_directory, + real_image_name, + 'image_license.manifest') + # if image_license.manifest exists, we can read the names of bzImage # and modules files for this build from it, then look for them # in the DEPLOY_DIR_IMAGE; note that this file is only produced @@ -1657,11 +1666,20 @@ class BuildInfoHelper(object): # store the license manifest path on the target # (this file is also created any time an image file is created) - license_path = os.path.join(license_directory, + license_manifest_path = os.path.join(license_directory, real_image_name, 'license.manifest') self.orm_wrapper.update_target_set_license_manifest( - image_target, license_path) + image_target, license_manifest_path) + + # store the package manifest path on the target (this file + # is created any time an image file is created) + package_manifest_path = os.path.join(deploy_dir_image, + real_image_name + '.rootfs.manifest') + + if os.path.exists(package_manifest_path): + self.orm_wrapper.update_target_set_package_manifest( + image_target, package_manifest_path) # scan the directory for image files relating to this build # (via real_image_name); note that we don't have to set diff --git a/lib/toaster/orm/migrations/0009_target_package_manifest_path.py b/lib/toaster/orm/migrations/0009_target_package_manifest_path.py new file mode 100644 index 000000000..c958f3070 --- /dev/null +++ b/lib/toaster/orm/migrations/0009_target_package_manifest_path.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('orm', '0008_refactor_artifact_models'), + ] + + operations = [ + migrations.AddField( + model_name='target', + name='package_manifest_path', + field=models.CharField(null=True, max_length=500), + ), + ] diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py index a1119168d..8e40f0aca 100644 --- a/lib/toaster/orm/models.py +++ b/lib/toaster/orm/models.py @@ -622,6 +622,7 @@ class Target(models.Model): is_image = models.BooleanField(default = False) image_size = models.IntegerField(default=0) license_manifest_path = models.CharField(max_length=500, null=True) + package_manifest_path = models.CharField(max_length=500, null=True) def package_count(self): return Target_Installed_Package.objects.filter(target_id__exact=self.id).count() @@ -729,9 +730,9 @@ class Target(models.Model): Target_Image_File object for an ext4 image being associated with a target for a project which didn't produce an ext4 image (for example). - Also sets the license_manifest_path of this target to the same path - as that of target being cloned from, as the license manifest path is - also a build artifact but is treated differently. + Also sets the license_manifest_path and package_manifest_path + of this target to the same path as that of target being cloned from, as + the manifests are also build artifacts but are treated differently. """ image_fstypes = self.build.get_image_fstypes() @@ -754,6 +755,7 @@ class Target(models.Model): kernel_file.save() self.license_manifest_path = target.license_manifest_path + self.package_manifest_path = target.package_manifest_path self.save() def clone_sdk_artifacts_from(self, target): diff --git a/lib/toaster/toastergui/templates/builddashboard.html b/lib/toaster/toastergui/templates/builddashboard.html index 32212ea8d..36c28b7d6 100644 --- a/lib/toaster/toastergui/templates/builddashboard.html +++ b/lib/toaster/toastergui/templates/builddashboard.html @@ -90,6 +90,12 @@ <dd> <a href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">License manifest</a> </dd> + + {% if target.target.package_manifest_path %} + <dd> + <a href="{% url 'build_artifact' build.pk 'packagemanifest' target.target.pk %}">Package manifest</a> + </dd> + {% endif %} </dl> <dl class="dl-horizontal"> diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py index baaa2883b..aab6536fa 100755 --- a/lib/toaster/toastergui/views.py +++ b/lib/toaster/toastergui/views.py @@ -2315,6 +2315,9 @@ if True: elif artifact_type == "licensemanifest": file_name = Target.objects.get(build = build, pk = artifact_id).license_manifest_path + elif artifact_type == "packagemanifest": + file_name = Target.objects.get(build = build, pk = artifact_id).package_manifest_path + elif artifact_type == "tasklogfile": file_name = Task.objects.get(build = build, pk = artifact_id).logfile |