Skip to contentSkip to conversation

meta/conf/templates/default/conf-description.txt: add a template description

PATCH New Alexander Kanavin 1 participant 3 messages Sep 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 meta/conf/templates/default/conf-description.txt: add a template description

Existing conf-notes.txt is not adequate in situations where the user needs to select a config template from several, or get an overview of them and is interested only in a brief explanation of what the template is for, but not extended multi-paragraph instructions for how to use it.

Such descriptions can be provided via conf-description.txt and this patch adds such a description for the oe-core default template.

Updates to the tools and a tool for selecting templates which will make specific use of the description will follow.

---
 meta/conf/templates/default/conf-description.txt | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 meta/conf/templates/default/conf-description.txt
meta/conf/templates/default/conf-description.txt new file +1 -0
new file mode 100644
index 00000000000..e49172fa0ce
@@ -0,0 +1 @@
+This is the default build configuration for the openembedded-core layer.
Signature · 1 line
2.30.2
#1 lore raw

PATCH 2/3 meta/lib/bblayers/buildconf.py: add support for configuration descriptions

---
 meta/lib/bblayers/buildconf.py           | 10 ++++++++--
 meta/lib/oeqa/selftest/cases/bblayers.py |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
meta/lib/bblayers/buildconf.py +8 -2
index ccab332adfb..a299b135669 100644
@@ -26,7 +26,10 @@ def plugin_init(plugins):
     return BuildConfPlugin()
 
 class BuildConfPlugin(LayerPlugin):
-    notes_fixme = """FIXME: Please place here the description of this build configuration.
+    notes_fixme = """FIXME: Please place here the detailed instructions for using this build configuration.
+They will be shown to the users when they set up their builds via TEMPLATECONF.
+"""
+    description_fixme = """FIXME: Please place here the short description of what this build configuration is for.
 It will be shown to the users when they set up their builds via TEMPLATECONF.
 """
 
@@ -47,14 +50,17 @@ It will be shown to the users when they set up their builds via TEMPLATECONF.
                     bblayers_data = bblayers_data.replace(abspath, "##OEROOT##/" + relpath)
                 dest.write(bblayers_data)
 
+        with open(os.path.join(destdir, "conf-description.txt"), 'w') as dest:
+            dest.write(self.description_fixme)
         with open(os.path.join(destdir, "conf-notes.txt"), 'w') as dest:
             dest.write(self.notes_fixme)
 
         logger.info("""Configuration template placed into {}
 Please review the files in there, and particularly provide a configuration description in {}
+and notes in {}
 You can try out the configuration with
 TEMPLATECONF={} . {}/oe-init-build-env build-try-{}"""
-.format(destdir, os.path.join(destdir, "conf-notes.txt"), destdir, oecorepath, templatename))
+.format(destdir, os.path.join(destdir, "conf-description.txt"), os.path.join(destdir, "conf-notes.txt"), destdir, oecorepath, templatename))
 
     def do_save_build_conf(self, args):
         """ 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. """
meta/lib/oeqa/selftest/cases/bblayers.py +1 -1
index 8faa0602348..819ddf51bcd 100644
@@ -121,7 +121,7 @@ class BitbakeLayers(OESelftestTestCase):
         self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority))
 
         result = runCmd('bitbake-layers save-build-conf {} {}'.format(layerpath, "buildconf-1"))
-        for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-notes.txt'):
+        for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-description.txt', 'conf-notes.txt'):
             fullpath = os.path.join(layerpath, "conf", "templates", "buildconf-1", f)
             self.assertTrue(os.path.exists(fullpath), "Template configuration file {} not found".format(fullpath))
 
Signature · 1 line
2.30.2
#2 lore raw

PATCH 3/3 scripts/oe-setup-builddir: add support for configuration descriptions

In reply to Alexander Kanavin

They are handled exactly same as conf-notes.txt.

---
 scripts/oe-setup-builddir | 10 ++++++++++
 1 file changed, 10 insertions(+)
scripts/oe-setup-builddir +10 -0
index 678aeac4be5..1b5dc55743e 100755
@@ -57,6 +57,7 @@ if [ -n "$TEMPLATECONF" ]; then
     fi
     OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
     OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
+    OECOREDESCRCONF="$TEMPLATECONF/conf-description.txt"
     OECORENOTESCONF="$TEMPLATECONF/conf-notes.txt"
 fi
 
@@ -98,6 +99,13 @@ EOM
     SHOWYPDOC=yes
 fi
 
+if [ -z "$OECOREDESCRCONF" ]; then
+    OECOREDESCRCONF="$OEROOT/meta/conf/templates/default/conf-description.txt"
+fi
+if [ ! -r "$BUILDDIR/conf/conf-description.txt" ]; then
+    [ ! -r "$OECOREDESCRCONF" ] || cp "$OECOREDESCRCONF" "$BUILDDIR/conf/conf-description.txt"
+fi
+
 if [ -z "$OECORENOTESCONF" ]; then
     OECORENOTESCONF="$OEROOT/meta/conf/templates/default/conf-notes.txt"
 fi
@@ -108,6 +116,7 @@ fi
 # Prevent disturbing a new GIT clone in same console
 unset OECORELOCALCONF
 unset OECORELAYERCONF
+unset OECOREDESCRCONF
 unset OECORENOTESCONF
 
 # Ending the first-time run message. Show the YP Documentation banner.
@@ -124,6 +133,7 @@ EOM
 #    unset SHOWYPDOC
 fi
 
+[ ! -r "$BUILDDIR/conf/conf-description.txt" ] || cat "$BUILDDIR/conf/conf-description.txt"
 [ ! -r "$BUILDDIR/conf/conf-notes.txt" ] || cat "$BUILDDIR/conf/conf-notes.txt"
 
 if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
Signature · 1 line
2.30.2