summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2016-04-07 16:34:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-09 23:00:43 +0100
commit7e902807cb6c6d453972a3af4d632e627aa5e1fb (patch)
treefb3c6d39285fc2d8b083ae13ff5da75f055ba0a6 /meta/lib/oe
parent7ce800c3a24bcbe14b6d204c177f89ba836cfd70 (diff)
downloadpoky-7e902807cb6c6d453972a3af4d632e627aa5e1fb.tar.gz
sstatesig.py: Split single locked sigs check into multiple checks
Add the SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK variables to replace SIGGEN_LOCKEDSIGS_CHECK_LEVEL. SIGGEN_LOCKEDSIGS_TASKSIG_CHECK will no control whether there is a warning or error if a task's hash in the locked signature file doesn't match the computed hash from the current metadata. SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK will control whther there is a warning or error if a task that supports sstate is in the locked signature file, but no sstate exists for the task. Previously you could only have warning/errors for both controlled by SIGGEN_LOCKEDSIGS_CHECK_LEVEL. This was an issue in the extensible sdk, because we know sstate won't exist for certain items in the reverse dependencies list for tasks. However, we still want to error if task signatures don't match. [YOCTO #9195] (From OE-Core rev: 0fe2a5e5ffd01e926d0f3d4c78ad9910296e2d1a) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/sstatesig.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 5828a9def8..b2319ff213 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -189,20 +189,35 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
189 f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(types.keys()))) 189 f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(types.keys())))
190 190
191 def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d): 191 def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d):
192 checklevel = d.getVar("SIGGEN_LOCKEDSIGS_CHECK_LEVEL", True) 192 warn_msgs = []
193 error_msgs = []
194 sstate_missing_msgs = []
195
193 for task in range(len(sq_fn)): 196 for task in range(len(sq_fn)):
194 if task not in ret: 197 if task not in ret:
195 for pn in self.lockedsigs: 198 for pn in self.lockedsigs:
196 if sq_hash[task] in self.lockedsigs[pn].itervalues(): 199 if sq_hash[task] in self.lockedsigs[pn].itervalues():
197 if sq_task[task] == 'do_shared_workdir': 200 if sq_task[task] == 'do_shared_workdir':
198 continue 201 continue
199 self.mismatch_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?" 202 sstate_missing_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?"
200 % (pn, sq_task[task], sq_hash[task])) 203 % (pn, sq_task[task], sq_hash[task]))
201 204
202 if self.mismatch_msgs and checklevel == 'warn': 205 checklevel = d.getVar("SIGGEN_LOCKEDSIGS_TASKSIG_CHECK", True)
203 bb.warn("\n".join(self.mismatch_msgs)) 206 if checklevel == 'warn':
204 elif self.mismatch_msgs and checklevel == 'error': 207 warn_msgs += self.mismatch_msgs
205 bb.fatal("\n".join(self.mismatch_msgs)) 208 elif checklevel == 'error':
209 error_msgs += self.mismatch_msgs
210
211 checklevel = d.getVar("SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK", True)
212 if checklevel == 'warn':
213 warn_msgs += sstate_missing_msgs
214 elif checklevel == 'error':
215 error_msgs += sstate_missing_msgs
216
217 if warn_msgs:
218 bb.warn("\n".join(warn_msgs))
219 if error_msgs:
220 bb.fatal("\n".join(error_msgs))
206 221
207 222
208# Insert these classes into siggen's namespace so it can see and select them 223# Insert these classes into siggen's namespace so it can see and select them