summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2024-02-16 12:52:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-19 11:47:53 +0000
commitf6f50200c97f77cfeaefa2699dbbc1a6da2692c3 (patch)
tree81fcae94f8bcff48cd68b1132449af476a715e70
parent6f29e2319cf8f6124de4998e887efab90bc63ba4 (diff)
downloadpoky-f6f50200c97f77cfeaefa2699dbbc1a6da2692c3.tar.gz
meta/lib/bblayers/buildconf.py: add support for configuration summaries
(From OE-Core rev: 7117e3d08570202c79d618d4fb6a67895b1df564) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/bblayers/buildconf.py12
-rw-r--r--meta/lib/oeqa/selftest/cases/bblayers.py2
2 files changed, 10 insertions, 4 deletions
diff --git a/meta/lib/bblayers/buildconf.py b/meta/lib/bblayers/buildconf.py
index 87a5e5a55b..722cf0723c 100644
--- a/meta/lib/bblayers/buildconf.py
+++ b/meta/lib/bblayers/buildconf.py
@@ -20,7 +20,10 @@ def plugin_init(plugins):
20 return BuildConfPlugin() 20 return BuildConfPlugin()
21 21
22class BuildConfPlugin(LayerPlugin): 22class BuildConfPlugin(LayerPlugin):
23 notes_fixme = """FIXME: Please place here the description of this build configuration. 23 notes_fixme = """FIXME: Please place here the detailed instructions for using this build configuration.
24They will be shown to the users when they set up their builds via TEMPLATECONF.
25"""
26 summary_fixme = """FIXME: Please place here the short summary of what this build configuration is for.
24It will be shown to the users when they set up their builds via TEMPLATECONF. 27It will be shown to the users when they set up their builds via TEMPLATECONF.
25""" 28"""
26 29
@@ -41,14 +44,17 @@ It will be shown to the users when they set up their builds via TEMPLATECONF.
41 bblayers_data = bblayers_data.replace(abspath, "##OEROOT##/" + relpath) 44 bblayers_data = bblayers_data.replace(abspath, "##OEROOT##/" + relpath)
42 dest.write(bblayers_data) 45 dest.write(bblayers_data)
43 46
47 with open(os.path.join(destdir, "conf-summary.txt"), 'w') as dest:
48 dest.write(self.summary_fixme)
44 with open(os.path.join(destdir, "conf-notes.txt"), 'w') as dest: 49 with open(os.path.join(destdir, "conf-notes.txt"), 'w') as dest:
45 dest.write(self.notes_fixme) 50 dest.write(self.notes_fixme)
46 51
47 logger.info("""Configuration template placed into {} 52 logger.info("""Configuration template placed into {}
48Please review the files in there, and particularly provide a configuration description in {} 53Please review the files in there, and particularly provide a configuration summary in {}
54and notes in {}
49You can try out the configuration with 55You can try out the configuration with
50TEMPLATECONF={} . {}/oe-init-build-env build-try-{}""" 56TEMPLATECONF={} . {}/oe-init-build-env build-try-{}"""
51.format(destdir, os.path.join(destdir, "conf-notes.txt"), destdir, oecorepath, templatename)) 57.format(destdir, os.path.join(destdir, "conf-summary.txt"), os.path.join(destdir, "conf-notes.txt"), destdir, oecorepath, templatename))
52 58
53 def do_save_build_conf(self, args): 59 def do_save_build_conf(self, args):
54 """ Save the currently active build configuration (conf/local.conf, conf/bblayers.conf) as a template into a layer.\n This template can later be used for setting up builds via TEMPLATECONF. """ 60 """ Save the currently active build configuration (conf/local.conf, conf/bblayers.conf) as a template into a layer.\n This template can later be used for setting up builds via TEMPLATECONF. """
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py
index 34363cd791..f2460cb451 100644
--- a/meta/lib/oeqa/selftest/cases/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -121,7 +121,7 @@ class BitbakeLayers(OESelftestTestCase):
121 self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) 121 self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority))
122 122
123 result = runCmd('bitbake-layers save-build-conf {} {}'.format(layerpath, "buildconf-1")) 123 result = runCmd('bitbake-layers save-build-conf {} {}'.format(layerpath, "buildconf-1"))
124 for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-notes.txt'): 124 for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-summary.txt', 'conf-notes.txt'):
125 fullpath = os.path.join(layerpath, "conf", "templates", "buildconf-1", f) 125 fullpath = os.path.join(layerpath, "conf", "templates", "buildconf-1", f)
126 self.assertTrue(os.path.exists(fullpath), "Template configuration file {} not found".format(fullpath)) 126 self.assertTrue(os.path.exists(fullpath), "Template configuration file {} not found".format(fullpath))
127 127