summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/bblayers.py
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2022-08-31 13:13:56 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-01 10:07:02 +0100
commit3f9e3feb2225b681318c81dc9977b2b9656a373c (patch)
treeddd664836944b0e99ed61caa92a1b39fa94e9ec0 /meta/lib/oeqa/selftest/cases/bblayers.py
parent8791c77a4098d62080ecad09d94718eccd7f1a47 (diff)
downloadpoky-3f9e3feb2225b681318c81dc9977b2b9656a373c.tar.gz
bitbake-layers: add a command to save the active build configuration as a template into a layer
This is the reverse of setting up a build by pointing TEMPLATECONF to a directory with a template and running '. oe-init-build-env': this takes the config files from build/conf, replaces site-specific paths in bblayers.conf with ##OECORE##-relative paths, and copies the config files into a specified layer under a specified template name. In many or perhaps most cases such static prefabricated configurations (that require no further editing) are just enough, and I believe they should be offered by the official configuration management. On the other hand, generating build configurations with a sufficiently versatile tool is a far more complex problem, and one we should try to tackle once we see where and how static configs fall short. Tooling to discover and select these templates when setting up a build will be provided later on. How to use: alex@Zen2:/srv/work/alex/poky/build-layersetup$ bitbake-layers save-build-conf ../../meta-alex/ test-1 NOTE: Starting bitbake server... NOTE: Configuration template placed into /srv/work/alex/meta-alex/conf/templates/test-1 Please review the files in there, and particularly provide a configuration description in /srv/work/alex/meta-alex/conf/templates/test-1/conf-notes.txt You can try out the configuration with TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/test-1 . /srv/work/alex/poky/oe-init-build-env build-try-test-1 alex@Zen2:/srv/work/alex/poky/build-layersetup$ (From OE-Core rev: f319534dc8fc68dfe120d129154a509f0cd6a3b0) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/bblayers.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/bblayers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py
index 494fa892a3..549abe7d10 100644
--- a/meta/lib/oeqa/selftest/cases/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -113,6 +113,11 @@ class BitbakeLayers(OESelftestTestCase):
113 113
114 self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) 114 self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority))
115 115
116 result = runCmd('bitbake-layers save-build-conf {} {}'.format(layerpath, "buildconf-1"))
117 for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-notes.txt'):
118 fullpath = os.path.join(layerpath, "conf", "templates", "buildconf-1", f)
119 self.assertTrue(os.path.exists(fullpath), "Template configuration file {} not found".format(fullpath))
120
116 def get_recipe_basename(self, recipe): 121 def get_recipe_basename(self, recipe):
117 recipe_file = "" 122 recipe_file = ""
118 result = runCmd("bitbake-layers show-recipes -f %s" % recipe) 123 result = runCmd("bitbake-layers show-recipes -f %s" % recipe)