diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-23 17:17:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-06-04 12:04:52 +0100 |
commit | 652e3028d9763aef318ff4587f2c21a8b280003f (patch) | |
tree | 11c7b5c4156795f83b87ffa7c7c5fc918c9a1c03 /meta/lib/oe/copy_buildsystem.py | |
parent | 56c578f6643c09e6d9274bb21381978deb1f4af1 (diff) | |
download | poky-652e3028d9763aef318ff4587f2c21a8b280003f.tar.gz |
sstatesig/populate_sdk_ext: Improve unihash cache handling
Copying in the bb_unihashes cache file was at best a hack and creates a number of
challenges. One is staying in sync with bitbake since it may not have saved the
most recent version of the file. A second is a determinism problem since there may
be more entries in the file than the SDK should have had access to.
To improve the situation, add code to write the data into the locked-sigs.inc file
such that even when locked-sigs aren't used, the right hash mappings are injected
by the get_cached_unihash call.
The functions in copy_buildsystem need to be updated to preserve data they're not
editting.
(From OE-Core rev: 11373def3171e75b3b74ef694da213dd21f3064c)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/copy_buildsystem.py')
-rw-r--r-- | meta/lib/oe/copy_buildsystem.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py index 81abfbf9e2..ced751b835 100644 --- a/meta/lib/oe/copy_buildsystem.py +++ b/meta/lib/oe/copy_buildsystem.py | |||
@@ -193,13 +193,17 @@ def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, onlynative, p | |||
193 | else: | 193 | else: |
194 | f.write(line) | 194 | f.write(line) |
195 | invalue = False | 195 | invalue = False |
196 | elif line.startswith('SIGGEN_LOCKEDSIGS'): | 196 | elif line.startswith('SIGGEN_LOCKEDSIGS_t'): |
197 | invalue = True | 197 | invalue = True |
198 | f.write(line) | 198 | f.write(line) |
199 | else: | ||
200 | invalue = False | ||
201 | f.write(line) | ||
199 | 202 | ||
200 | def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_output, copy_output=None): | 203 | def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_output, copy_output=None): |
201 | merged = {} | 204 | merged = {} |
202 | arch_order = [] | 205 | arch_order = [] |
206 | otherdata = [] | ||
203 | with open(lockedsigs_main, 'r') as f: | 207 | with open(lockedsigs_main, 'r') as f: |
204 | invalue = None | 208 | invalue = None |
205 | for line in f: | 209 | for line in f: |
@@ -212,6 +216,9 @@ def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_outpu | |||
212 | invalue = line[18:].split('=', 1)[0].rstrip() | 216 | invalue = line[18:].split('=', 1)[0].rstrip() |
213 | merged[invalue] = [] | 217 | merged[invalue] = [] |
214 | arch_order.append(invalue) | 218 | arch_order.append(invalue) |
219 | else: | ||
220 | invalue = None | ||
221 | otherdata.append(line) | ||
215 | 222 | ||
216 | with open(lockedsigs_extra, 'r') as f: | 223 | with open(lockedsigs_extra, 'r') as f: |
217 | invalue = None | 224 | invalue = None |
@@ -246,6 +253,7 @@ def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_outpu | |||
246 | f.write(' "\n') | 253 | f.write(' "\n') |
247 | fulltypes.append(typename) | 254 | fulltypes.append(typename) |
248 | f.write('SIGGEN_LOCKEDSIGS_TYPES = "%s"\n' % ' '.join(fulltypes)) | 255 | f.write('SIGGEN_LOCKEDSIGS_TYPES = "%s"\n' % ' '.join(fulltypes)) |
256 | f.write('\n' + ''.join(otherdata)) | ||
249 | 257 | ||
250 | if copy_output: | 258 | if copy_output: |
251 | write_sigs_file(copy_output, list(tocopy.keys()), tocopy) | 259 | write_sigs_file(copy_output, list(tocopy.keys()), tocopy) |