summaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index c05e6e0ecc..ff97098e2f 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -141,6 +141,54 @@ 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
144def get_deployed_dependencies(d):
145 """
146 Get all the deployed dependencies of an image
147 """
148
149 deploy = {}
150 # Get all the dependencies for the current task (rootfs).
151 # Also get EXTRA_IMAGEDEPENDS because the bootloader is
152 # usually in this var and not listed in rootfs.
153 # At last, get the dependencies from boot classes because
154 # it might contain the bootloader.
155 taskdata = d.getVar("BB_TASKDEPDATA", True)
156 depends = list(set([dep[0] for dep
157 in taskdata.itervalues()
158 if not dep[0].endswith("-native")]))
159 extra_depends = d.getVar("EXTRA_IMAGEDEPENDS", True)
160 boot_depends = get_boot_dependencies(d)
161 depends.extend(extra_depends.split())
162 depends.extend(boot_depends)
163 depends = list(set(depends))
164
165 # To verify what was deployed it checks the rootfs dependencies against
166 # the SSTATE_MANIFESTS for "deploy" task.
167 # The manifest file name contains the arch. Because we are not running
168 # in the recipe context it is necessary to check every arch used.
169 sstate_manifest_dir = d.getVar("SSTATE_MANIFESTS", True)
170 sstate_archs = d.getVar("SSTATE_ARCHS", True)
171 extra_archs = d.getVar("PACKAGE_EXTRA_ARCHS", True)
172 archs = list(set(("%s %s" % (sstate_archs, extra_archs)).split()))
173 for dep in depends:
174 # Some recipes have an arch on their own, so we try that first.
175 special_arch = d.getVar("PACKAGE_ARCH_pn-%s" % dep, True)
176 if special_arch:
177 sstate_manifest_file = os.path.join(sstate_manifest_dir,
178 "manifest-%s-%s.deploy" % (special_arch, dep))
179 if os.path.exists(sstate_manifest_file):
180 deploy[dep] = sstate_manifest_file
181 continue
182
183 for arch in archs:
184 sstate_manifest_file = os.path.join(sstate_manifest_dir,
185 "manifest-%s-%s.deploy" % (arch, dep))
186 if os.path.exists(sstate_manifest_file):
187 deploy[dep] = sstate_manifest_file
188 break
189
190 return deploy
191
144def get_boot_dependencies(d): 192def get_boot_dependencies(d):
145 """ 193 """
146 Return the dependencies from boot tasks 194 Return the dependencies from boot tasks