summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-07-12 15:54:54 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-19 08:56:52 +0100
commit2db40e377148c862161125a56bb3b9d5d2ed9a7c (patch)
tree70b5ec7b437a13488061fd5a798a26268790a9d7 /bitbake/lib
parent1027e0e313c4743a7ddb5e192013fba5d7ad0e1c (diff)
downloadpoky-2db40e377148c862161125a56bb3b9d5d2ed9a7c.tar.gz
bitbake: 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. (Bitbake rev: 79b8e349a0da2ea6b97ad82daa5837e6dfffe0af) 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 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py24
-rw-r--r--bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py19
-rw-r--r--bitbake/lib/toaster/orm/models.py8
-rw-r--r--bitbake/lib/toaster/toastergui/templates/builddashboard.html6
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py3
5 files changed, 54 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 52b5e12bff..91189f60ec 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -256,6 +256,10 @@ class ORMWrapper(object):
256 target.license_manifest_path = license_manifest_path 256 target.license_manifest_path = license_manifest_path
257 target.save() 257 target.save()
258 258
259 def update_target_set_package_manifest(self, target, package_manifest_path):
260 target.package_manifest_path = package_manifest_path
261 target.save()
262
259 def update_task_object(self, build, task_name, recipe_name, task_stats): 263 def update_task_object(self, build, task_name, recipe_name, task_stats):
260 """ 264 """
261 Find the task for build which matches the recipe and task name 265 Find the task for build which matches the recipe and task name
@@ -1597,7 +1601,7 @@ class BuildInfoHelper(object):
1597 machine = self.server.runCommand(['getVariable', 'MACHINE'])[0] 1601 machine = self.server.runCommand(['getVariable', 'MACHINE'])[0]
1598 image_name = self.server.runCommand(['getVariable', 'IMAGE_NAME'])[0] 1602 image_name = self.server.runCommand(['getVariable', 'IMAGE_NAME'])[0]
1599 1603
1600 # location of the image_license.manifest files for this build; 1604 # location of the manifest files for this build;
1601 # note that this file is only produced if an image is produced 1605 # note that this file is only produced if an image is produced
1602 license_directory = \ 1606 license_directory = \
1603 self.server.runCommand(['getVariable', 'LICENSE_DIRECTORY'])[0] 1607 self.server.runCommand(['getVariable', 'LICENSE_DIRECTORY'])[0]
@@ -1636,6 +1640,11 @@ class BuildInfoHelper(object):
1636 real_image_name, 1640 real_image_name,
1637 'image_license.manifest') 1641 'image_license.manifest')
1638 1642
1643 image_package_manifest_path = os.path.join(
1644 license_directory,
1645 real_image_name,
1646 'image_license.manifest')
1647
1639 # if image_license.manifest exists, we can read the names of bzImage 1648 # if image_license.manifest exists, we can read the names of bzImage
1640 # and modules files for this build from it, then look for them 1649 # and modules files for this build from it, then look for them
1641 # in the DEPLOY_DIR_IMAGE; note that this file is only produced 1650 # in the DEPLOY_DIR_IMAGE; note that this file is only produced
@@ -1657,11 +1666,20 @@ class BuildInfoHelper(object):
1657 1666
1658 # store the license manifest path on the target 1667 # store the license manifest path on the target
1659 # (this file is also created any time an image file is created) 1668 # (this file is also created any time an image file is created)
1660 license_path = os.path.join(license_directory, 1669 license_manifest_path = os.path.join(license_directory,
1661 real_image_name, 'license.manifest') 1670 real_image_name, 'license.manifest')
1662 1671
1663 self.orm_wrapper.update_target_set_license_manifest( 1672 self.orm_wrapper.update_target_set_license_manifest(
1664 image_target, license_path) 1673 image_target, license_manifest_path)
1674
1675 # store the package manifest path on the target (this file
1676 # is created any time an image file is created)
1677 package_manifest_path = os.path.join(deploy_dir_image,
1678 real_image_name + '.rootfs.manifest')
1679
1680 if os.path.exists(package_manifest_path):
1681 self.orm_wrapper.update_target_set_package_manifest(
1682 image_target, package_manifest_path)
1665 1683
1666 # scan the directory for image files relating to this build 1684 # scan the directory for image files relating to this build
1667 # (via real_image_name); note that we don't have to set 1685 # (via real_image_name); note that we don't have to set
diff --git a/bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py b/bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py
new file mode 100644
index 0000000000..c958f3070d
--- /dev/null
+++ b/bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py
@@ -0,0 +1,19 @@
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4from django.db import migrations, models
5
6
7class Migration(migrations.Migration):
8
9 dependencies = [
10 ('orm', '0008_refactor_artifact_models'),
11 ]
12
13 operations = [
14 migrations.AddField(
15 model_name='target',
16 name='package_manifest_path',
17 field=models.CharField(null=True, max_length=500),
18 ),
19 ]
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index a1119168dd..8e40f0aca2 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -622,6 +622,7 @@ class Target(models.Model):
622 is_image = models.BooleanField(default = False) 622 is_image = models.BooleanField(default = False)
623 image_size = models.IntegerField(default=0) 623 image_size = models.IntegerField(default=0)
624 license_manifest_path = models.CharField(max_length=500, null=True) 624 license_manifest_path = models.CharField(max_length=500, null=True)
625 package_manifest_path = models.CharField(max_length=500, null=True)
625 626
626 def package_count(self): 627 def package_count(self):
627 return Target_Installed_Package.objects.filter(target_id__exact=self.id).count() 628 return Target_Installed_Package.objects.filter(target_id__exact=self.id).count()
@@ -729,9 +730,9 @@ class Target(models.Model):
729 Target_Image_File object for an ext4 image being associated with a 730 Target_Image_File object for an ext4 image being associated with a
730 target for a project which didn't produce an ext4 image (for example). 731 target for a project which didn't produce an ext4 image (for example).
731 732
732 Also sets the license_manifest_path of this target to the same path 733 Also sets the license_manifest_path and package_manifest_path
733 as that of target being cloned from, as the license manifest path is 734 of this target to the same path as that of target being cloned from, as
734 also a build artifact but is treated differently. 735 the manifests are also build artifacts but are treated differently.
735 """ 736 """
736 737
737 image_fstypes = self.build.get_image_fstypes() 738 image_fstypes = self.build.get_image_fstypes()
@@ -754,6 +755,7 @@ class Target(models.Model):
754 kernel_file.save() 755 kernel_file.save()
755 756
756 self.license_manifest_path = target.license_manifest_path 757 self.license_manifest_path = target.license_manifest_path
758 self.package_manifest_path = target.package_manifest_path
757 self.save() 759 self.save()
758 760
759 def clone_sdk_artifacts_from(self, target): 761 def clone_sdk_artifacts_from(self, target):
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
index 32212ea8d4..36c28b7d6a 100644
--- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
+++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -90,6 +90,12 @@
90 <dd> 90 <dd>
91 <a href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">License manifest</a> 91 <a href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">License manifest</a>
92 </dd> 92 </dd>
93
94 {% if target.target.package_manifest_path %}
95 <dd>
96 <a href="{% url 'build_artifact' build.pk 'packagemanifest' target.target.pk %}">Package manifest</a>
97 </dd>
98 {% endif %}
93 </dl> 99 </dl>
94 100
95 <dl class="dl-horizontal"> 101 <dl class="dl-horizontal">
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index baaa2883bc..aab6536fa0 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2315,6 +2315,9 @@ if True:
2315 elif artifact_type == "licensemanifest": 2315 elif artifact_type == "licensemanifest":
2316 file_name = Target.objects.get(build = build, pk = artifact_id).license_manifest_path 2316 file_name = Target.objects.get(build = build, pk = artifact_id).license_manifest_path
2317 2317
2318 elif artifact_type == "packagemanifest":
2319 file_name = Target.objects.get(build = build, pk = artifact_id).package_manifest_path
2320
2318 elif artifact_type == "tasklogfile": 2321 elif artifact_type == "tasklogfile":
2319 file_name = Task.objects.get(build = build, pk = artifact_id).logfile 2322 file_name = Task.objects.get(build = build, pk = artifact_id).logfile
2320 2323