meta-poky/conf/templates/default/bblayers.conf.sample: do not assume integrated poky repo
PATCH 1/2 meta-poky/conf/templates/default/bblayers.conf.sample: do not assume integrated poky repo
From: Alexander Kanavin <[email protected]>
The list of layers was written assuming the template is used with the 'integrated' poky checkout, where content of meta-yocto is 'overlaid' on content of openembedded-core, and the layers are all in the same top level poky repository directory.
This doesn't work when oe-core and meta-yocto are cloned separately, where relative path that starts from oe-core would have to go one level above oe-core and then go into meta-yocto, assuming the separate repo clones are in the same top level directory.
This requires a custom tweak to bblayers.conf when it makes its way from meta-yocto into poky that would strip the ../meta-yocto/ part in BBLAYERS. As there are already numerous other tweaks of similar nature, I think this is feasible.
This was prompted by
https://lists.openembedded.org/g/openembedded-architecture/topic/layer_layout_poky_vs/111010762
--- meta-poky/conf/templates/default/bblayers.conf.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta-poky/conf/templates/default/bblayers.conf.sample +2 -2
@@ -7,6 +7,6 @@ BBFILES ?= "" BBLAYERS ?= " \ ##OEROOT##/meta \ - ##OEROOT##/meta-poky \ - ##OEROOT##/meta-yocto-bsp \ + ##OEROOT##/../meta-yocto/meta-poky \ + ##OEROOT##/../meta-yocto/meta-yocto-bsp \ "
Signature · 1 line
2.39.5
PATCH 2/2 meta-poky/conf/templates: add a blank template
From: Alexander Kanavin <[email protected]>
The default oe-core/poky templates have a number of settings (such as distro and machine) and are thus unsuitable for building up configurations from fragments. This adds a template with an empty local.conf, so that it can be used as the starting point for fragment-driven configuration.
There will also be a blank template in oe-core; the difference is that this one includes poky layers and the oe-core one does not.
--- .../conf/templates/blank/bblayers.conf.sample | 12 ++++++++++++ meta-poky/conf/templates/blank/conf-notes.txt | 19 +++++++++++++++++++ .../conf/templates/blank/conf-summary.txt | 1 + .../conf/templates/blank/local.conf.sample | 10 ++++++++++ 4 files changed, 42 insertions(+) create mode 100644 meta-poky/conf/templates/blank/bblayers.conf.sample create mode 100644 meta-poky/conf/templates/blank/conf-notes.txt create mode 100644 meta-poky/conf/templates/blank/conf-summary.txt create mode 100644 meta-poky/conf/templates/blank/local.conf.sample
meta-poky/conf/templates/blank/bblayers.conf.sample new file +12 -0
@@ -0,0 +1,12 @@ +# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +POKY_BBLAYERS_CONF_VERSION = "2" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/../meta-yocto/meta-poky \ + ##OEROOT##/../meta-yocto/meta-yocto-bsp \ + "
meta-poky/conf/templates/blank/conf-notes.txt new file +19 -0
@@ -0,0 +1,19 @@ + +### Shell environment set up for builds. ### + +You can now run 'bitbake <target>' + +Common targets are: + core-image-minimal + core-image-full-cmdline + core-image-sato + core-image-weston + meta-toolchain + meta-ide-support + +You can also run generated qemu images with a command like 'runqemu qemux86-64'. + +Other commonly useful commands are: + - 'devtool' and 'recipetool' handle common recipe tasks + - 'bitbake-layers' handles common layer tasks + - 'oe-pkgdata-util' handles common target package tasks
meta-poky/conf/templates/blank/conf-summary.txt new file +1 -0
@@ -0,0 +1 @@ +This configuration is empty and is intended as a starting point for adding configuration fragments.
meta-poky/conf/templates/blank/local.conf.sample new file +10 -0
@@ -0,0 +1,10 @@ +# +# This file is intended for local configuration tweaks. It is intentionally +# set up empty, so that configuration can be constructed from fragments +# using bitbake-config-build tool and by setting MACHINE and DISTRO here. +# +# If you would like to publish this file (for example as a bitbake +# configuration template), it is recommended to create fragments +# from changes made here; the only settings that can remain are +# MACHINE and DISTRO. +#
Signature · 1 line
2.39.5
Quoted 12 lines · Alexander Kanavin via lists.yoctoproject.org
From: Alexander Kanavin <[email protected]>
The list of layers was written assuming the template is used with the 'integrated' poky checkout, where content of meta-yocto is 'overlaid' on content of openembedded-core, and the layers are all in the same top level poky repository directory.
This doesn't work when oe-core and meta-yocto are cloned separately, where relative path that starts from oe-core would have to go one level above oe-core and then go into meta-yocto, assuming the separate repo clones are in the same top level directory.
Quoted 4 lines
This requires a custom tweak to bblayers.conf when it makes its way from meta-yocto into poky that would strip the ../meta-yocto/ part in BBLAYERS. As there are already numerous other tweaks of similar nature, I think this is feasible.
Which other tweaks of a similar nature are made? I'm not aware of any file contents changing between repos...
Cheers,
Richard
Quoted 7 lines · Richard Purdie
Quoted 4 lines
This requires a custom tweak to bblayers.conf when it makes its way from meta-yocto into poky that would strip the ../meta-yocto/ part in BBLAYERS. As there are already numerous other tweaks of similar nature, I think this is feasible.
Which other tweaks of a similar nature are made? I'm not aware of any file contents changing between repos...
Right, this refers to the poky integration process that cherry-picks files and directories from original repos, e.g. the default template from oe-core (meta/conf/templates/default) does not make it into poky at all.
The patch follows the suggestion that such a tweak is possible:
https://lists.openembedded.org/g/openembedded-architecture/message/2129
Alex
Quoted 13 lines · Alexander Kanavin
Quoted 10 lines · Richard Purdie
Quoted 6 lines
This requires a custom tweak to bblayers.conf when it makes its way
from meta-yocto into poky that would strip the ../meta-yocto/ part in
BBLAYERS. As there are already numerous other tweaks of similar nature, I think this is feasible.Which other tweaks of a similar nature are made? I'm not aware of any
file contents changing between repos...
Quoted 7 lines
Right, this refers to the poky integration process that cherry-picks files and directories from original repos, e.g. the default template from oe-core (meta/conf/templates/default) does not make it into poky at all.
The patch follows the suggestion that such a tweak is possible:
https://lists.openembedded.org/g/openembedded-architecture/message/2129
Ah, that is a bit different. There aren't tweaks of a similar nature. I'll need to give this more thought...
Cheers,
Richard
Quoted 6 lines · Richard Purdie
Quoted 3 lines
The patch follows the suggestion that such a tweak is possible:
https://lists.openembedded.org/g/openembedded-architecture/message/2129Ah, that is a bit different. There aren't tweaks of a similar nature. I'll need to give this more thought...
No problem. I'll adjust the commit message meanwhile.
Alex
Quoted 10 lines · Richard Purdie
Quoted 7 lines
Right, this refers to the poky integration process that cherry-picks files and directories from original repos, e.g. the default template from oe-core (meta/conf/templates/default) does not make it into poky at all.
The patch follows the suggestion that such a tweak is possible:
https://lists.openembedded.org/g/openembedded-architecture/message/2129Ah, that is a bit different. There aren't tweaks of a similar nature. I'll need to give this more thought...
I want to put my thoughts (and a proposal) forward: the real issue here is that BBLAYERS is a list of full paths, and thus is not relocatable. And there's lots of awkwardness around changing that list relative to ##OEROOT## and back in templates (and ##OEROOT##-prefixed paths are still not relocatable).
I tried to think of a way to specify layer identifiers instead, and have some kind of 'magic' figuring out where the layers are in the filesystem. One option is something like this:
BBLAYERS_SEARCH_PATHS = "/path/to/where/layers/are /some/other/path/with/layers" BBLAYERS_IDS = "core yocto intel"
e.g. bitbake would walk the filesystem starting from those paths (they would be set by bitbake-setup or other tools performing layer checkouts), and add any matching layers to the build.
I think that's actually not too horrible. Should I try to prototype this? One nice consequence is that it makes templates optional for those who do not like them: one could instead set the build entirely from just a list of fragments (machine/distro built-ins at a minimum :) and layer ids. Having to maintain templates for any possible layer combination doesn't scale, same way as on-disk fragments for machines/distros wouldn't scale.
Alex
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Alexander Kanavin via lists.yoctoproject.org
I think that's actually not too horrible. Should I try to prototype this? One nice consequence is that it makes templates optional for those who do not like them: one could instead set the build entirely from just a list of fragments (machine/distro built-ins at a minimum :) and layer ids. Having to maintain templates for any possible layer combination doesn't scale, same way as on-disk fragments for machines/distros wouldn't scale.
After some 'background brain processing', I've convinced myself that the best way out is that bitbake-setup would be able to write out bblayers.conf itself directly, from its own configuration file. Yes, like kas does :) I've resisted this for a long time, on the principle that bitbake-setup has no business directly meddling in build/conf/, but really, every other option is not as good.
So, a configuration entry could look like this:
"qemux86-64-poky": {
"description": "Poky reference distro build for qemux86-64",
"bb-layers":
["openembedded-core/meta","meta-yocto/meta-poky","meta-yocto/meta-yocto-bsp"],
"oe-fragments":
["machine/qemux86-64","distro/poky","core/yocto/sstate-mirror-cdn"],
"targets": ["bitbake core-image-minimal
core-image-full-cmdline core-image-sato-sdk core-image-weston"]
},and would not require templates at all.
Bitbake-setup would write out bblayers.conf with BBLAYERS entry ('bitbake-layers add-layer' can't be used at that point yet), and then enable fragments via bitbake-config-build (this is already implemented). This should result in a functional build directory, with a blank (or absent) local.conf.
Then this patch, and the ones adding 'blank' templates become unnecessary.
Alex
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Alexander Kanavin via lists.yoctoproject.org
Bitbake-setup would write out bblayers.conf with BBLAYERS entry ('bitbake-layers add-layer' can't be used at that point yet), and then enable fragments via bitbake-config-build (this is already implemented). This should result in a functional build directory, with a blank (or absent) local.conf.
Then this patch, and the ones adding 'blank' templates become unnecessary.
I've now implemented this and resent the bitbake-setup patches. The sample 'poky-ng' config that doesn't need templates and specifies layers directly is here:
https://github.com/kanavin/bitbake-setup-configurations/blob/main/yocto-master.conf.json
Alex