aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-11-12 12:36:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-01 21:07:19 +0000
commitb165c2d3349115546c9db2f084eb6def4913b82d (patch)
tree4ed0443c82e2404c490efa047704b3d5e2342254 /meta/classes/license.bbclass
parent71fb5da7a3a8e61b15be4efc05b968c0c9920d2f (diff)
downloadopenembedded-core-contrib-b165c2d3349115546c9db2f084eb6def4913b82d.tar.gz
license.bbclass: Added get_boot_dependencies function
This function gets the dependencies from the classes that create a boot image, this is required because sometimes the bootloader dependecy is in these classes. The current classes covered are bootimg and bootdirectdisk because these are the only clases that add dependencies. [YOCTO #6772] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 0d91dc6a95..c05e6e0ecc 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -141,6 +141,42 @@ def write_license_files(d, license_manifest, pkg_dic):
os.link(pkg_license, pkg_rootfs_license)
+def get_boot_dependencies(d):
+ """
+ Return the dependencies from boot tasks
+ """
+
+ depends = []
+ boot_depends_string = ""
+ taskdepdata = d.getVar("BB_TASKDEPDATA", True)
+ # Only bootimg and bootdirectdisk include the depends flag
+ boot_tasks = ["do_bootimg", "do_bootdirectdisk",]
+
+ for task in boot_tasks:
+ boot_depends_string = "%s %s" % (boot_depends_string,
+ d.getVarFlag(task, "depends", True) or "")
+ boot_depends = [dep.split(":")[0] for dep
+ in boot_depends_string.split()
+ if not dep.split(":")[0].endswith("-native")]
+ for dep in boot_depends:
+ info_file = os.path.join(d.getVar("LICENSE_DIRECTORY", True),
+ dep, "recipeinfo")
+ # If the recipe and dependency name is the same
+ if os.path.exists(info_file):
+ depends.append(dep)
+ # We need to search for the provider of the dependency
+ else:
+ for taskdep in taskdepdata.itervalues():
+ # The fifth field contains what the task provides
+ if dep in taskdep[4]:
+ info_file = os.path.join(
+ d.getVar("LICENSE_DIRECTORY", True),
+ taskdep[0], "recipeinfo")
+ if os.path.exists(info_file):
+ depends.append(taskdep[0])
+ break
+ return depends
+
python do_populate_lic() {
"""
Populate LICENSE_DIRECTORY with licenses.