* [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON
@ 2025-11-17 19:48 Joshua Watt
2025-11-17 19:48 ` [bitbake-devel][PATCH 2/2] default-registry: Change default setup dir Joshua Watt
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Joshua Watt @ 2025-11-17 19:48 UTC (permalink / raw)
To: bitbake-devel; +Cc: Joshua Watt
Enables the JSON file to specify the preferred name of the setup
directory with a 'setup-dir-name' key. This key can have variable
expansions in the same format as python string.Template strings (which
matches the shell variable expansion rules).
Variables that can be expanded are any fragment configuration prompted
by the user (e.g. the keys in "oe-fragments-one-of"), or "$name" to use
the name of the configuration (e.g. the .conf.json file).
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
bin/bitbake-setup | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 7e9491fac..7ee182bf3 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -17,6 +17,7 @@ import glob
import subprocess
import copy
import textwrap
+import string
default_registry = os.path.normpath(os.path.dirname(__file__) + "/../default-registry")
@@ -467,7 +468,15 @@ def init_config(top_dir, settings, args, d):
if args.setup_dir_name:
setup_dir_name = args.setup_dir_name
else:
- setup_dir_name = "{}-{}".format(upstream_config['name']," ".join(upstream_config['non-interactive-cmdline-options'][1:]).replace(" ","-").replace("/","_"))
+ if 'setup-dir-name' in upstream_config['bitbake-config']:
+ mapping = {
+ k: v.replace(" ", "-").replace("/", "_")
+ for k, v in upstream_config['bitbake-config']['oe-fragment-choices'].items()
+ }
+ setup_dir_name = string.Template(upstream_config['bitbake-config']['setup-dir-name']).substitute(mapping)
+ else:
+ setup_dir_name = "{}-{}".format(upstream_config['name']," ".join(upstream_config['non-interactive-cmdline-options'][1:]).replace(" ","-").replace("/","_"))
+
if not args.non_interactive:
n = input(f"Enter setup directory name: [{setup_dir_name}] ")
if n:
--
2.51.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bitbake-devel][PATCH 2/2] default-registry: Change default setup dir
2025-11-17 19:48 [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON Joshua Watt
@ 2025-11-17 19:48 ` Joshua Watt
2025-11-17 19:53 ` [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON Alexander Kanavin
[not found] ` <1878E35BD8113CE6.1265056@lists.openembedded.org>
2 siblings, 0 replies; 6+ messages in thread
From: Joshua Watt @ 2025-11-17 19:48 UTC (permalink / raw)
To: bitbake-devel; +Cc: Joshua Watt
Uses the template mechanism to provide shorter setup-dir names by
default. Specifically, the machine names are no longer part of the setup
path since they are intended to be changed without needing a new setup
directory.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
default-registry/configurations/oe-nodistro.conf.json | 1 +
default-registry/configurations/poky-master.conf.json | 1 +
2 files changed, 2 insertions(+)
diff --git a/default-registry/configurations/oe-nodistro.conf.json b/default-registry/configurations/oe-nodistro.conf.json
index 7619738b1..7ed00584f 100644
--- a/default-registry/configurations/oe-nodistro.conf.json
+++ b/default-registry/configurations/oe-nodistro.conf.json
@@ -43,6 +43,7 @@
{
"name": "nodistro",
"description": "OpenEmbedded 'nodistro'",
+ "setup-dir-name": "oe-nodistro",
"bb-layers": ["openembedded-core/meta"],
"oe-fragments-one-of": {
"machine": {
diff --git a/default-registry/configurations/poky-master.conf.json b/default-registry/configurations/poky-master.conf.json
index 60531ba02..e55ff796e 100644
--- a/default-registry/configurations/poky-master.conf.json
+++ b/default-registry/configurations/poky-master.conf.json
@@ -54,6 +54,7 @@
"configurations": [
{
"bb-layers": ["openembedded-core/meta","meta-yocto/meta-yocto-bsp","meta-yocto/meta-poky"],
+ "setup-dir-name": "poky-master-$distro",
"oe-fragments-one-of": {
"machine": {
"description": "Target machines",
--
2.51.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON
2025-11-17 19:48 [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON Joshua Watt
2025-11-17 19:48 ` [bitbake-devel][PATCH 2/2] default-registry: Change default setup dir Joshua Watt
@ 2025-11-17 19:53 ` Alexander Kanavin
[not found] ` <1878E35BD8113CE6.1265056@lists.openembedded.org>
2 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2025-11-17 19:53 UTC (permalink / raw)
To: JPEWhacker; +Cc: bitbake-devel
On Mon, 17 Nov 2025 at 20:48, Joshua Watt via lists.openembedded.org
<JPEWhacker=gmail.com@lists.openembedded.org> wrote:
> - setup_dir_name = "{}-{}".format(upstream_config['name']," ".join(upstream_config['non-interactive-cmdline-options'][1:]).replace(" ","-").replace("/","_"))
> + if 'setup-dir-name' in upstream_config['bitbake-config']:
> + mapping = {
> + k: v.replace(" ", "-").replace("/", "_")
> + for k, v in upstream_config['bitbake-config']['oe-fragment-choices'].items()
> + }
> + setup_dir_name = string.Template(upstream_config['bitbake-config']['setup-dir-name']).substitute(mapping)
> + else:
> + setup_dir_name = "{}-{}".format(upstream_config['name']," ".join(upstream_config['non-interactive-cmdline-options'][1:]).replace(" ","-").replace("/","_"))
This (and the actual json tweaks) greatly increases the chances of
directory names clashing, so there should be a check for existence,
and a logic to deal with it (probably just fall back to the full
style)?
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON
[not found] ` <1878E35BD8113CE6.1265056@lists.openembedded.org>
@ 2025-11-17 19:55 ` Alexander Kanavin
2025-11-17 19:57 ` Joshua Watt
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Kanavin @ 2025-11-17 19:55 UTC (permalink / raw)
To: alex.kanavin; +Cc: JPEWhacker, bitbake-devel
On Mon, 17 Nov 2025 at 20:53, Alexander Kanavin via
lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
wrote:
> This (and the actual json tweaks) greatly increases the chances of
> directory names clashing, so there should be a check for existence,
> and a logic to deal with it (probably just fall back to the full
> style)?
Also see my proposal for a setting. There are pros and cons for either
approach, I just would like you to read and consider it.
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON
2025-11-17 19:55 ` Alexander Kanavin
@ 2025-11-17 19:57 ` Joshua Watt
2025-11-17 20:02 ` Alexander Kanavin
0 siblings, 1 reply; 6+ messages in thread
From: Joshua Watt @ 2025-11-17 19:57 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
On Mon, Nov 17, 2025, 12:55 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:
> On Mon, 17 Nov 2025 at 20:53, Alexander Kanavin via
> lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
> wrote:
> > This (and the actual json tweaks) greatly increases the chances of
> > directory names clashing, so there should be a check for existence,
> > and a logic to deal with it (probably just fall back to the full
> > style)?
>
> Also see my proposal for a setting. There are pros and cons for either
> approach, I just would like you to read and consider it.
>
Ya this was more just to show how to do the template string per request,
not necessarily the complete solution. I probably should have sent it as an
RFC.
> Alex
>
[-- Attachment #2: Type: text/html, Size: 1590 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON
2025-11-17 19:57 ` Joshua Watt
@ 2025-11-17 20:02 ` Alexander Kanavin
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2025-11-17 20:02 UTC (permalink / raw)
To: Joshua Watt; +Cc: bitbake-devel
On Mon, 17 Nov 2025 at 20:58, Joshua Watt <jpewhacker@gmail.com> wrote:
>> > This (and the actual json tweaks) greatly increases the chances of
>> > directory names clashing, so there should be a check for existence,
>> > and a logic to deal with it (probably just fall back to the full
>> > style)?
>>
>> Also see my proposal for a setting. There are pros and cons for either
>> approach, I just would like you to read and consider it.
>
>
> Ya this was more just to show how to do the template string per request, not necessarily the complete solution. I probably should have sent it as an RFC.
My C is that I'm okay with this, if it also comes with a
'force-full-setup-dir-name' setting :)
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-11-17 20:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 19:48 [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON Joshua Watt
2025-11-17 19:48 ` [bitbake-devel][PATCH 2/2] default-registry: Change default setup dir Joshua Watt
2025-11-17 19:53 ` [bitbake-devel][PATCH 1/2] bitbake-setup: Allow setup-dir-name to be specified in JSON Alexander Kanavin
[not found] ` <1878E35BD8113CE6.1265056@lists.openembedded.org>
2025-11-17 19:55 ` Alexander Kanavin
2025-11-17 19:57 ` Joshua Watt
2025-11-17 20:02 ` Alexander Kanavin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.