Skip to contentSkip to conversation

bitbake-setup: add the proof of concept implementation

RFC PATCH Alexander Kanavin 2 participants 5 messages Jan 22, 2025 – Jan 23, 2025 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 3 lines · Alexander Kanavin via lists.openembedded.org

Default parameter values are in /home/alex/.bitbake-setup/config - adjust as needed.

Fetching configuration repository git://github.com/kanavin/bitbake-setup-configurations.git;protocol=https;branch=main;rev=main into /home/alex/.bitbake-setup/configurations

After some consideration I've concluded that placing the bitbake-setup tool configuration and caches into hardcoded ~/.bitbake-setup/ is not the best idea. Rather, the tool should write and read everything using a 'top level' directory, which can be set via command line switch, environment variable, or a default of ~/bitbake-builds/, in that priority order.

There should also be an additional operation called 'write-tool-config' or similar, which would do nothing except write out the standard tool config to the top level directory. That way it can be inspected and modified (for example to point to a different build config repo or dl_dir) prior to any actual build init or to listing available configurations (which would do fetches using that config etc.). One can still start directly with 'init' or 'list' but then a default config will be written out to the top level directory without asking.

Automated bootstrapping from nothing is tricky to get right :)

Alex

#2 lore raw
Quoted 10 lines · Alexander Kanavin via lists.openembedded.org
Quoted 1 line · Alexander Kanavin via lists.openembedded.org

Default parameter values are in /home/alex/.bitbake-setup/config -

adjust as needed.

Quoted 2 lines

Fetching configuration repository git://

github.com/kanavin/bitbake-setup-configurations.git;protocol=https;branch=main;rev=main into /home/alex/.bitbake-setup/configurations

Quoted 7 lines

After some consideration I've concluded that placing the bitbake-setup tool configuration and caches into hardcoded ~/.bitbake-setup/ is not the best idea. Rather, the tool should write and read everything using a 'top level' directory, which can be set via command line switch, environment variable, or a default of ~/bitbake-builds/, in that priority order.

Agreed on the command line switch. But what about making ~/.config/bitbake the default
and falling back to $XDG_CONFIG_HOME/bitbake as a secondary default? That would be
closer to what is considered "standard" behavior and probably make it easier to manage in
the long run.

..Ch:W..

Signature · 2 lines
*"Perfection must be reached by degrees; she requires the slow hand of
time." - Voltaire*
#3 lore raw
Quoted 8 lines · Chuck Wolber
Quoted 6 lines

After some consideration I've concluded that placing the bitbake-setup tool configuration and caches into hardcoded ~/.bitbake-setup/ is not the best idea. Rather, the tool should write and read everything using a 'top level' directory, which can be set via command line switch, environment variable, or a default of ~/bitbake-builds/, in that priority order.

Quoted 4 lines

Agreed on the command line switch. But what about making ~/.config/bitbake the default and falling back to $XDG_CONFIG_HOME/bitbake as a secondary default? That would be closer to what is considered "standard" behavior and probably make it easier to manage in the long run.

This would still allow only a single tool config per user. This config has things like location of the build configuration repository, or where to cache downloads, and possibly other things in the future. It's better to allow multiple configs, one per top level build directory. One can conceivably want to use multiple such repositories, or have different DL_DIRs for different things.

E.g. like this:

alex@Zen2:/srv/work/alex/bitbake/bin$ cat
/home/alex/bitbake-builds/bitbake-setup.conf

[default]
registry = git://github.com/kanavin/bitbake-setup-configurations.git;protocol=https;branch=main;rev=main
dl-dir = /home/alex/bitbake-builds/.bitbake-setup-downloads

Alex

#4 lore raw

Terminology for bitbake-setup

In reply to a message not in the archive
Quoted 2 lines · Alexander Kanavin via lists.openembedded.org

- tighten the terminology: 'build' and 'configuration' are each used to refer to several distinct things, and should be replaced by specific, unambiguous terms

So here's the hopefully sensible :) proposal. Note that each section below cross-references definitions in other sections, so the full picture will not form until the end :)

- 'top directory' means the place under which bitbake-setup reads and writes everything. It makes a promise to not touch anything outside of that, unless otherwise directed to by entries in settings (currently there is one such setting for fetcher downloads for layers and config registries). Top directory can be selected by a command line option, or otherwise assumed to be ~/bitbake-builds/

- 'settings' means bitbake-setup operational parameters that are global to all builds under a top directory. E.g. the location of configuration registry, or where the bitbake fetcher should place the downloads (DL_DIR setting). Settings are stored in a .conf file in ini format just under the top directory.

- ' build' means a tree structure set up by 'bitbake-setup init', consisting of, at least, a layers checkout, and a set of bitbake builds. It maps 1:1 to the json data it was constructed from, which is called 'configuration'. Configuration files are either standalone files, or are obtained from git repositories called 'config registries', in which case they can be listed with 'bitbake-setup list'. There can be multiple 'builds' under a top directory. Here's an example configuration that showcases this:
https://github.com/kanavin/bitbake-setup-configurations/blob/main/poky-alex.conf.json

- 'bitbake-setup status' will tell if a configuration is in sync with the build. 'bitbake-setup update' will bring them in sync if needed.

- 'bitbake build' means a particular sub-tree inside a build that bitbake itself operates on, e.g. what is specified in BBPATH/BUILDDIR by oe-init-build-env. conf/* in that tree is 'bitbake configuration'. Bitbake configurations are constructed from templates and fragments, with existing mechanisms provided by oe-core. I structured the configuration file format such that other mechanisms to set up a bitbake build can be added; there was a mention of ability to specify local.conf content and a set of layers directly in a configuration. I think that scales poorly compared to templates and fragments, but I made sure alternative ways to configure a bitbake build are possible to specify in a configuration :)

Finally, this is how bitbake-setup already works; I just need to go over the code, and make adjustments to variable/function names and printouts to ensure there's no ambiguity or confusion.

Cheers,
Alex

#5 lore raw

Re: Terminology for bitbake-setup

Quoted 6 lines · Alexander Kanavin

- 'top directory' means the place under which bitbake-setup reads and writes everything. It makes a promise to not touch anything outside of that, unless otherwise directed to by entries in settings (currently there is one such setting for fetcher downloads for layers and config registries). Top directory can be selected by a command line option, or otherwise assumed to be ~/bitbake-builds/

Of course I managed to forget something :) If BBPATH is in environment (e.g. we are in a bitbake environment), then the top directory is deduced from that and doesn't need to be specified by hand. I need to check that bitbake-setup gracefully handles the situation when BBPATH is present, but the bitbake build is a 'legacy' one that is not inside a bitbake-setup-made build tree.

Alex