summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake-setup
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-11-06 18:08:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-06 18:04:13 +0000
commit516039e60916da4c3bb39f0d0c18d721e7ecf75e (patch)
tree5bb500e91d0a5ed97ca7244ac9b5ea6b4a376ee3 /bitbake/bin/bitbake-setup
parent9780ec24d070b0638492c0f153a7ed776c150ed5 (diff)
downloadpoky-master.tar.gz
bitbake: bitbake-setup: replace {THISDIR} token with a keyword: bb-layers-relativeHEADmaster
{THISDIR} is a special value token that can be used in the list of enabled layers to specify the layer location relative to the confguration file: https://git.openembedded.org/bitbake/commit/?id=b3153be29de8b8570b0c184369bd41f4c646cf92 This replaces the token with an explicit separate keyword for such layers: so that special processing to determine the final value can be avoided, and the feature can be formalized in the json schema: instead of "bb-layers": [ "{THISDIR}/meta-my-project" ] this allows "bb-layers-relative": [ "meta-my-project" Going forward I think we should strive to avoid any further special value tokens. (Bitbake rev: 90da82bd2bfcfd5590c9ae06015737b616074b56) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake-setup')
-rwxr-xr-xbitbake/bin/bitbake-setup28
1 files changed, 16 insertions, 12 deletions
diff --git a/bitbake/bin/bitbake-setup b/bitbake/bin/bitbake-setup
index 47de4654e3..29fdf11892 100755
--- a/bitbake/bin/bitbake-setup
+++ b/bitbake/bin/bitbake-setup
@@ -129,21 +129,24 @@ def checkout_layers(layers, layerdir, d):
129 return layers_fixed_revisions 129 return layers_fixed_revisions
130 130
131def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir): 131def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
132 def _setup_build_conf(layers, build_conf_dir): 132 def _setup_build_conf(layers, relative_layers, build_conf_dir):
133 os.makedirs(build_conf_dir) 133 os.makedirs(build_conf_dir)
134 layers_s = [] 134 layers_s = []
135
135 for l in layers: 136 for l in layers:
136 if l.startswith("{THISDIR}/"): 137 l = os.path.join(layerdir, l)
137 if thisdir: 138 layers_s.append(" {} \\".format(l))
138 l = l.format(THISDIR=thisdir) 139
139 else: 140 for l in relative_layers:
140 raise Exception("Configuration is using {THISDIR} to specify " \ 141 if thisdir:
141 "a layer path relative to itself. This can be done only " \ 142 l = os.path.join(thisdir, l)
142 "when the configuration is specified by its path on local " \ 143 else:
143 "disk, not when it's in a registry or is fetched over http.") 144 raise Exception("Configuration is using bb-layers-relative to specify " \
144 if not os.path.isabs(l): 145 "a layer path relative to itself. This can be done only " \
145 l = os.path.join(layerdir, l) 146 "when the configuration is specified by its path on local " \
147 "disk, not when it's in a registry or is fetched over http.")
146 layers_s.append(" {} \\".format(l)) 148 layers_s.append(" {} \\".format(l))
149
147 layers_s = "\n".join(layers_s) 150 layers_s = "\n".join(layers_s)
148 bblayers_conf = """BBLAYERS ?= " \\ 151 bblayers_conf = """BBLAYERS ?= " \\
149{} 152{}
@@ -220,7 +223,8 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
220 os.rename(bitbake_confdir, backup_bitbake_confdir) 223 os.rename(bitbake_confdir, backup_bitbake_confdir)
221 224
222 if layers: 225 if layers:
223 _setup_build_conf(layers, bitbake_confdir) 226 relative_layers = bitbake_config.get("bb-layers-relative") or []
227 _setup_build_conf(layers, relative_layers, bitbake_confdir)
224 228
225 if template: 229 if template:
226 bb.process.run("{} setup -c {} -b {} --no-shell".format(oesetupbuild, template, bitbake_builddir)) 230 bb.process.run("{} setup -c {} -b {} --no-shell".format(oesetupbuild, template, bitbake_builddir))