summaryrefslogtreecommitdiffstats
path: root/meta/classes/license_image.bbclass
diff options
context:
space:
mode:
authorVyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>2020-11-17 15:41:20 +0100
committerSteve Sakoman <steve@sakoman.com>2020-11-30 12:05:57 -1000
commitd31fd6a2fc2334a20d4fd1bcfe5964c462d1bb98 (patch)
tree8649a9471283f71eaca176bcf8c02eac4e32a346 /meta/classes/license_image.bbclass
parent8edd935405d6fb3b1822bbbbea41fae892629cb5 (diff)
downloadopenembedded-core-d31fd6a2fc2334a20d4fd1bcfe5964c462d1bb98.tar.gz
license_image.bbclass: use canonical name for license files
When copying license files to the image rootfs, i.e to /usr/share/common-licenses, a canonical name of a license should be used, otherwise duplicated files end up in common-licenses directory. For example, GPL-2.0 license according to conf/license.conf can be referenced in recipes as GPL-2, GPLv2, and GPLv2.0. If a license name is used directly, we end up with three files in the rootfs with the same content. If a canonical name used instead, then each license gets copied only once. Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 670fe71dd18ea675f35581db4a61fda137f8bf00) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes/license_image.bbclass')
-rw-r--r--meta/classes/license_image.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass
index a8c72da3cb..acd8126f68 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -125,7 +125,6 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
licenses = os.listdir(pkg_license_dir)
for lic in licenses:
- rootfs_license = os.path.join(rootfs_license_dir, lic)
pkg_license = os.path.join(pkg_license_dir, lic)
pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic)
@@ -144,6 +143,8 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
bad_licenses) == False:
continue
+ # Make sure we use only canonical name for the license file
+ rootfs_license = os.path.join(rootfs_license_dir, "generic_%s" % generic_lic)
if not os.path.exists(rootfs_license):
oe.path.copyhardlink(pkg_license, rootfs_license)