summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/copy_buildsystem.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/copy_buildsystem.py')
-rw-r--r--meta/lib/oe/copy_buildsystem.py58
1 files changed, 56 insertions, 2 deletions
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index a5ca3df320..64755107d8 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -93,10 +93,64 @@ def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, pruned_output
93 invalue = True 93 invalue = True
94 f.write(line) 94 f.write(line)
95 95
96def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_output, copy_output):
97 merged = {}
98 arch_order = []
99 with open(lockedsigs_main, 'r') as f:
100 invalue = None
101 for line in f:
102 if invalue:
103 if line.endswith('\\\n'):
104 merged[invalue].append(line)
105 else:
106 invalue = None
107 elif line.startswith('SIGGEN_LOCKEDSIGS_t-'):
108 invalue = line[18:].split('=', 1)[0].rstrip()
109 merged[invalue] = []
110 arch_order.append(invalue)
111
112 with open(lockedsigs_extra, 'r') as f:
113 invalue = None
114 tocopy = {}
115 for line in f:
116 if invalue:
117 if line.endswith('\\\n'):
118 if not line in merged[invalue]:
119 target, task = line.strip().split(':')[:2]
120 if task in copy_tasks:
121 tocopy[invalue].append(line)
122 merged[invalue].append(line)
123 else:
124 invalue = None
125 elif line.startswith('SIGGEN_LOCKEDSIGS_t-'):
126 invalue = line[18:].split('=', 1)[0].rstrip()
127 if not invalue in merged:
128 merged[invalue] = []
129 arch_order.append(invalue)
130 tocopy[invalue] = []
131
132 def write_sigs_file(fn, types, sigs):
133 fulltypes = []
134 bb.utils.mkdirhier(os.path.dirname(fn))
135 with open(fn, 'w') as f:
136 for typename in types:
137 lines = sigs[typename]
138 if lines:
139 f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % typename)
140 for line in lines:
141 f.write(line)
142 f.write(' "\n')
143 fulltypes.append(typename)
144 f.write('SIGGEN_LOCKEDSIGS_TYPES = "%s"\n' % ' '.join(fulltypes))
145
146 write_sigs_file(copy_output, tocopy.keys(), tocopy)
147 write_sigs_file(merged_output, arch_order, merged)
148
96def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cache, d, fixedlsbstring=""): 149def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cache, d, fixedlsbstring=""):
97 bb.note('Generating sstate-cache...') 150 bb.note('Generating sstate-cache...')
98 151
99 bb.process.run("gen-lockedsig-cache %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache)) 152 bb.process.run("gen-lockedsig-cache %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache))
100 if fixedlsbstring: 153 if fixedlsbstring:
101 os.rename(output_sstate_cache + '/' + d.getVar('NATIVELSBSTRING', True), 154 nativedir = output_sstate_cache + '/' + d.getVar('NATIVELSBSTRING', True)
102 output_sstate_cache + '/' + fixedlsbstring) 155 if os.path.isdir(nativedir):
156 os.rename(nativedir, output_sstate_cache + '/' + fixedlsbstring)