]> code.ossystems Code Review - openembedded-core.git/commitdiff
license_image.bbclass: Create symlink to the image license manifest dir
authorDiego Sueiro <diego.sueiro@arm.com>
Tue, 1 Sep 2020 07:12:16 +0000 (08:12 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Sep 2020 14:58:05 +0000 (15:58 +0100)
In the LICENSE_DIRECTORY each time an image recipe is built a new directory
is created to hold the image license manifests.

By creating a symlink to the most recent created image license manifest
directory, we make things easier for users to collect and pack the data.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license_image.bbclass

index a8c72da3cbe7a8c242551dbcb7d5978752549a5d..682d46237f27bba1dc5924dc62efadaa5a3f2bbe 100644 (file)
@@ -200,6 +200,15 @@ def license_deployed_manifest(d):
     image_license_manifest = os.path.join(lic_manifest_dir, 'image_license.manifest')
     write_license_files(d, image_license_manifest, man_dic, rootfs=False)
 
+    lic_manifest_symlink_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'),
+                                    d.getVar('IMAGE_LINK_NAME'))
+    # remove old symlink
+    if os.path.islink(lic_manifest_symlink_dir):
+        os.unlink(lic_manifest_symlink_dir)
+
+    # create the image dir symlink
+    os.symlink(lic_manifest_dir, lic_manifest_symlink_dir)
+
 def get_deployed_dependencies(d):
     """
     Get all the deployed dependencies of an image