diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2015-11-12 12:36:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:32:01 +0000 |
commit | d45e10e1cf872e86925df33731fc5b03cf97064c (patch) | |
tree | bb68f9fce432d6907ad4bf8e13926c3c0f0d8029 /meta | |
parent | 8b1e7bcef2126b0b7f8070c277d04e3b22c5b961 (diff) | |
download | poky-d45e10e1cf872e86925df33731fc5b03cf97064c.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]
(From OE-Core rev: b165c2d3349115546c9db2f084eb6def4913b82d)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/license.bbclass | 36 |
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): | |||
141 | os.link(pkg_license, pkg_rootfs_license) | 141 | os.link(pkg_license, pkg_rootfs_license) |
142 | 142 | ||
143 | 143 | ||
144 | def get_boot_dependencies(d): | ||
145 | """ | ||
146 | Return the dependencies from boot tasks | ||
147 | """ | ||
148 | |||
149 | depends = [] | ||
150 | boot_depends_string = "" | ||
151 | taskdepdata = d.getVar("BB_TASKDEPDATA", True) | ||
152 | # Only bootimg and bootdirectdisk include the depends flag | ||
153 | boot_tasks = ["do_bootimg", "do_bootdirectdisk",] | ||
154 | |||
155 | for task in boot_tasks: | ||
156 | boot_depends_string = "%s %s" % (boot_depends_string, | ||
157 | d.getVarFlag(task, "depends", True) or "") | ||
158 | boot_depends = [dep.split(":")[0] for dep | ||
159 | in boot_depends_string.split() | ||
160 | if not dep.split(":")[0].endswith("-native")] | ||
161 | for dep in boot_depends: | ||
162 | info_file = os.path.join(d.getVar("LICENSE_DIRECTORY", True), | ||
163 | dep, "recipeinfo") | ||
164 | # If the recipe and dependency name is the same | ||
165 | if os.path.exists(info_file): | ||
166 | depends.append(dep) | ||
167 | # We need to search for the provider of the dependency | ||
168 | else: | ||
169 | for taskdep in taskdepdata.itervalues(): | ||
170 | # The fifth field contains what the task provides | ||
171 | if dep in taskdep[4]: | ||
172 | info_file = os.path.join( | ||
173 | d.getVar("LICENSE_DIRECTORY", True), | ||
174 | taskdep[0], "recipeinfo") | ||
175 | if os.path.exists(info_file): | ||
176 | depends.append(taskdep[0]) | ||
177 | break | ||
178 | return depends | ||
179 | |||
144 | python do_populate_lic() { | 180 | python do_populate_lic() { |
145 | """ | 181 | """ |
146 | Populate LICENSE_DIRECTORY with licenses. | 182 | Populate LICENSE_DIRECTORY with licenses. |