From 652e3028d9763aef318ff4587f2c21a8b280003f Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 23 May 2024 17:17:30 +0100 Subject: 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 --- meta/lib/oe/copy_buildsystem.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'meta/lib/oe/copy_buildsystem.py') 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 else: f.write(line) invalue = False - elif line.startswith('SIGGEN_LOCKEDSIGS'): + elif line.startswith('SIGGEN_LOCKEDSIGS_t'): invalue = True f.write(line) + else: + invalue = False + f.write(line) def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_output, copy_output=None): merged = {} arch_order = [] + otherdata = [] with open(lockedsigs_main, 'r') as f: invalue = None for line in f: @@ -212,6 +216,9 @@ def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_outpu invalue = line[18:].split('=', 1)[0].rstrip() merged[invalue] = [] arch_order.append(invalue) + else: + invalue = None + otherdata.append(line) with open(lockedsigs_extra, 'r') as f: invalue = None @@ -246,6 +253,7 @@ def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_outpu f.write(' "\n') fulltypes.append(typename) f.write('SIGGEN_LOCKEDSIGS_TYPES = "%s"\n' % ' '.join(fulltypes)) + f.write('\n' + ''.join(otherdata)) if copy_output: write_sigs_file(copy_output, list(tocopy.keys()), tocopy) -- cgit v1.2.3-54-g00ecf