summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Riegel <damien.riegel@savoirfairelinux.com>2018-06-15 20:18:38 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-18 11:07:57 +0100
commit7d3ad1405ca3f891db82091f31783a650a6bc681 (patch)
tree5f6a0a8a40cd9c41289ff978a2af1226378ef695
parent1ecb384c110706f210f9b3bc66772a2f5d89e904 (diff)
downloadpoky-7d3ad1405ca3f891db82091f31783a650a6bc681.tar.gz
populate_sdk_ext.bbclass: fix corebase identification
When generating the extended SDK, there is a copy step where this class goes through the layers and other stuff that have been copied to generate the SDK. The corebase; ie. the folder that contains the core layer 'meta' is treated in a special way. Unfortunately in our tree, we have: sources/meta/meta | `- core layer `------- corebase In populate_sdk_ext's copy_buildsystem, the heuristic to determine which element of the list returned by copy_bitbake_and_layers is corebase is fooled by such layout. In copy_bitbake_and_layers, corebase is already handled specifically and reliably, so we should let that function tell us which folder is corebase instead of trying to determine it. To do so, change the return type of copy_bitbake_and_layers to a tuple that contains (corebase, copied_layers). It also simplifies the code on the caller side. (From OE-Core rev: 5368bc5d0d3606198b93e877bcafcd77bb5f4fd1) Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/populate_sdk_ext.bbclass12
-rw-r--r--meta/lib/oe/copy_buildsystem.py8
2 files changed, 8 insertions, 12 deletions
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index e1bba49eaf..f0c8709c5b 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -200,15 +200,9 @@ python copy_buildsystem () {
200 workspace_name = 'orig-workspace' 200 workspace_name = 'orig-workspace'
201 else: 201 else:
202 workspace_name = None 202 workspace_name = None
203 layers_copied = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers', workspace_name) 203
204 204 corebase, sdkbblayers = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers', workspace_name)
205 sdkbblayers = [] 205 conf_bbpath = os.path.join('layers', corebase, 'bitbake')
206 corebase = os.path.basename(d.getVar('COREBASE'))
207 for layer in layers_copied:
208 if corebase == os.path.basename(layer):
209 conf_bbpath = os.path.join('layers', layer, 'bitbake')
210 else:
211 sdkbblayers.append(layer)
212 206
213 for path in os.listdir(baseoutpath + '/layers'): 207 for path in os.listdir(baseoutpath + '/layers'):
214 relpath = os.path.join('layers', path, oe_init_env_script) 208 relpath = os.path.join('layers', path, oe_init_env_script)
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index 4b94806c73..4abec4666f 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -26,6 +26,7 @@ class BuildSystem(object):
26 26
27 def copy_bitbake_and_layers(self, destdir, workspace_name=None): 27 def copy_bitbake_and_layers(self, destdir, workspace_name=None):
28 # Copy in all metadata layers + bitbake (as repositories) 28 # Copy in all metadata layers + bitbake (as repositories)
29 copied_corebase = None
29 layers_copied = [] 30 layers_copied = []
30 bb.utils.mkdirhier(destdir) 31 bb.utils.mkdirhier(destdir)
31 layers = list(self.layerdirs) 32 layers = list(self.layerdirs)
@@ -84,17 +85,18 @@ class BuildSystem(object):
84 85
85 layer_relative = os.path.relpath(layerdestpath, 86 layer_relative = os.path.relpath(layerdestpath,
86 destdir) 87 destdir)
87 layers_copied.append(layer_relative)
88
89 # Treat corebase as special since it typically will contain 88 # Treat corebase as special since it typically will contain
90 # build directories or other custom items. 89 # build directories or other custom items.
91 if corebase == layer: 90 if corebase == layer:
91 copied_corebase = layer_relative
92 bb.utils.mkdirhier(layerdestpath) 92 bb.utils.mkdirhier(layerdestpath)
93 for f in corebase_files: 93 for f in corebase_files:
94 f_basename = os.path.basename(f) 94 f_basename = os.path.basename(f)
95 destname = os.path.join(layerdestpath, f_basename) 95 destname = os.path.join(layerdestpath, f_basename)
96 _smart_copy(f, destname) 96 _smart_copy(f, destname)
97 else: 97 else:
98 layers_copied.append(layer_relative)
99
98 if os.path.exists(os.path.join(layerdestpath, 'conf/layer.conf')): 100 if os.path.exists(os.path.join(layerdestpath, 'conf/layer.conf')):
99 bb.note("Skipping layer %s, already handled" % layer) 101 bb.note("Skipping layer %s, already handled" % layer)
100 else: 102 else:
@@ -140,7 +142,7 @@ class BuildSystem(object):
140 layers_copied.remove(layer) 142 layers_copied.remove(layer)
141 break 143 break
142 144
143 return layers_copied 145 return copied_corebase, layers_copied
144 146
145def generate_locked_sigs(sigfile, d): 147def generate_locked_sigs(sigfile, d):
146 bb.utils.mkdirhier(os.path.dirname(sigfile)) 148 bb.utils.mkdirhier(os.path.dirname(sigfile))