Skip to contentSkip to conversation

src: New XML/XSLT generation of config files.

RFC New Ryan Eatmon 1 participant 1 message Oct 16, 2024

lore
Share & tools
lore
#0 lore raw

RFC 1/1 src: New XML/XSLT generation of config files.

In an attempt to meet the needs of our various customers that are using other layer setup tools, we are going to start providing our configs in existing oe-layersetup, kas, and the upcoming bitbake-setup formats as well.

This will be accomplished by storing the config information in XML format and using XSLT to generate all of the other formats so that they all align with the same layers, branches, etc...

---
 README                                    |  39 ++
 conf/layer.conf                           |   3 +
 src/Makefile                              | 284 +++++++++++++++
 src/bin/check.pl                          |  16 +
 src/bin/convert.pl                        | 412 ++++++++++++++++++++++
 src/common/motd_cicd.xml                  |   9 +
 src/common/targets_arago.xml              |   8 +
 src/common/targets_poky.xml               |   3 +
 src/xslt/bitbake-setup-bblayers-conf.xslt |  45 +++
 src/xslt/bitbake-setup-conf-notes.xslt    |  32 ++
 src/xslt/bitbake-setup-conf-summary.xslt  |   9 +
 src/xslt/bitbake-setup-local-conf.xslt    |  34 ++
 src/xslt/bitbake-setup.xslt               |  72 ++++
 src/xslt/kas-templates.xslt               |  38 ++
 src/xslt/kas.xslt                         |  70 ++++
 src/xslt/oe-layersetup-templates.xslt     |  25 ++
 src/xslt/oe-layersetup.xslt               |  75 ++++
 17 files changed, 1174 insertions(+)
 create mode 100644 README
 create mode 100644 conf/layer.conf
 create mode 100644 src/Makefile
 create mode 100755 src/bin/check.pl
 create mode 100755 src/bin/convert.pl
 create mode 100644 src/common/motd_cicd.xml
 create mode 100644 src/common/targets_arago.xml
 create mode 100644 src/common/targets_poky.xml
 create mode 100644 src/xslt/bitbake-setup-bblayers-conf.xslt
 create mode 100644 src/xslt/bitbake-setup-conf-notes.xslt
 create mode 100644 src/xslt/bitbake-setup-conf-summary.xslt
 create mode 100644 src/xslt/bitbake-setup-local-conf.xslt
 create mode 100644 src/xslt/bitbake-setup.xslt
 create mode 100644 src/xslt/kas-templates.xslt
 create mode 100644 src/xslt/kas.xslt
 create mode 100644 src/xslt/oe-layersetup-templates.xslt
 create mode 100644 src/xslt/oe-layersetup.xslt
README new file +39 -0
new file mode 100644
index 0000000..040d308
@@ -0,0 +1,39 @@
+
+The oe-layersetup repository was created by Texas Instruments back in 2012
+as both a tool for configuring OpenEmbedded builds and the place to house
+the configuration files for rebuilding all of the releases of our software.
+It pre-dates most of the other tools by several years and has been in active
+use by TI's customers since its creation both directly and indirectly as
+we use these configs to drive our build processes for our TISDK packages
+on ti.com.
+
+The oe-layersetup script has some useful features that include:
+
+  - Specifying the git repositories, branch, and commit on the branch you
+    want to configure the build for.
+  - The layers in the repository that you want to include in the build.
+  - A set of templates to use in the creation of the bblayers.conf and
+    the local.conf.
+  - A message of the day feature that can print a block of text to the
+    screen when running the tool against a config file.
+  - Custom local.conf settings that you need to include for the build you
+    are setting up.
+
+With the creation and rise in popularity of some of the newer tools, including
+the upcoming bitbake-setup tool, it is time to broaden our support for our
+build configuration into some of these other newer tools.
+
+To that end, we have migrated all of our configurations into an XML format
+that serves to capture all of the bits of information that the different tools
+need.  Additionally, we have created a Makefile and XSLT files that can
+generate the various configuration files for oe-layersetup, kas, and
+bitbake-setup.
+
+If you want to add a new configuration, you need to create the appropriate XML
+file in src/configs, run make in src, and then commit all of the new files.
+
+- cd src
+- Edit configs/.../config.xml
+- make
+- git status
+
conf/layer.conf new file +3 -0
new file mode 100644
index 0000000..4997038
@@ -0,0 +1,3 @@
+BBFILE_COLLECTIONS += "oe-layersetup"
+LAYERVERSION_oe-layersetup = "1"
+LAYERSERIES_COMPAT_oe-layersetup = "kirkstone scarthgap styhead walnascar"
src/Makefile new file +284 -0

284 lines not on this page · raw message

src/bin/check.pl new file +16 -0
new file mode 100755
index 0000000..4b31bbb
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+
+use strict;
+
+my @loDiffs = qx( diff -wBrq /scratch/work/oe-layersetup/configs /scratch/work/oe-layersetup/configs2 );
+
+foreach my $lpDiff (@loDiffs)
+{
+    my ($lpA,$lpB) = ($lpDiff =~ /Files (.+) and (.+) differ/);
+
+    if (defined($lpA) && defined($lpB))
+    {
+        system("tkdiff -w -B $lpA $lpB");
+    }
+}
+
src/bin/convert.pl new file +412 -0

412 lines not on this page · raw message

src/common/motd_cicd.xml new file +9 -0
new file mode 100644
index 0000000..95a3ba9
@@ -0,0 +1,9 @@
+<motd>
+    <line>NOTE:</line>
+    <line>NOTE: This config is reserved for CI/CD testing and requires manual intervention to build</line>
+    <line>NOTE:</line>
+    <line>NOTE: A few SRCREVs in the recipes might refer to commits on cicd/next branches for their</line>
+    <line>NOTE: repos.  These recipes will not build correctly without also a change in your local.conf</line>
+    <line>NOTE: to point the recipe to the appropriate cicd/next branch for that recipe.</line>
+    <line>NOTE:</line>
+</motd>
src/common/targets_arago.xml new file +8 -0
new file mode 100644
index 0000000..01d1b55
@@ -0,0 +1,8 @@
+<targets>
+    <default>tisdk-default-image</default>
+    <target>tisdk-base-image</target>
+    <target>tisdk-bootstrap-base-image</target>
+    <target>tisdk-bootstrap-image</target>
+    <target>tisdk-thinlinux-image</target>
+    <target>tisdk-tiny-image</target>
+</targets>
src/common/targets_poky.xml new file +3 -0
new file mode 100644
index 0000000..74b89aa
@@ -0,0 +1,3 @@
+<targets>
+    <default>core_image_minimal</default>
+</targets>
src/xslt/bitbake-setup-bblayers-conf.xslt new file +45 -0

45 lines not on this page · raw message

src/xslt/bitbake-setup-conf-notes.xslt new file +32 -0
new file mode 100644
index 0000000..2dfba81
@@ -0,0 +1,32 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
+
+<xsl:template match="/">
+<xsl:text>
+### Shell environment set up for builds. ###
+
+You can now run 'bitbake &lt;target&gt;'
+
+If you have not set MACHINE in your local.conf you can run
+'MACHINE=xxxxx bitbake &lt;target&gt;'
+
+Common targets are:
+    </xsl:text><xsl:value-of select='config/targets/default/text()'/><xsl:text>
+</xsl:text>
+<xsl:apply-templates select='config/targets/target'/>
+<xsl:text>
+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
+</xsl:text>
+</xsl:template>
+
+<xsl:template match='config/targets/target'>
+<xsl:text>    </xsl:text><xsl:value-of select='text()'/><xsl:text>
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
src/xslt/bitbake-setup-conf-summary.xslt new file +9 -0
new file mode 100644
index 0000000..88bbd7a
@@ -0,0 +1,9 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
+
+<xsl:template match="/">
+<xsl:value-of select='config/description/text()'/><xsl:text>
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
src/xslt/bitbake-setup-local-conf.xslt new file +34 -0
new file mode 100644
index 0000000..c5c5e60
@@ -0,0 +1,34 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
+
+<xsl:template match="/">
+<xsl:apply-templates select='config/local-conf-template'/>
+<xsl:apply-templates select='config/local-conf'/>
+</xsl:template>
+
+<xsl:template match='local-conf-template'>
+<xsl:for-each select='line'>
+<xsl:value-of select='text()'/>
+<xsl:text>
+</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match='config/local-conf'>
+<xsl:text>
+
+#====================================================================
+# Settings from oe-layersetup config file: </xsl:text><xsl:value-of select='$arConfigName'/><xsl:text>
+#
+# Do not remove.
+#--------------------------------------------------------------------
+</xsl:text>
+<xsl:for-each select='line'>
+<xsl:value-of select='text()'/><xsl:text>
+</xsl:text>
+</xsl:for-each>
+<xsl:text>#====================================================================
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
src/xslt/bitbake-setup.xslt new file +72 -0

72 lines not on this page · raw message

src/xslt/kas-templates.xslt new file +38 -0
new file mode 100644
index 0000000..57277f1
@@ -0,0 +1,38 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
+
+<xsl:template match="/">header:
+  version: 17
+
+<xsl:apply-templates select='bblayers-conf-template'/>
+<xsl:apply-templates select='local-conf-template'/>
+</xsl:template>
+
+<xsl:template match='bblayers-conf-template'>
+<xsl:text>bblayers_conf_header:
+</xsl:text>
+<xsl:text>  oe-layersetup-bblayers-conf-template: |
+</xsl:text>
+<xsl:for-each select='line'>
+<xsl:text>    </xsl:text><xsl:value-of select='text()'/><xsl:text>
+</xsl:text>
+</xsl:for-each>
+<xsl:text>
+</xsl:text>
+</xsl:template>
+
+<xsl:template match='local-conf-template'>
+<xsl:text>local_conf_header:
+</xsl:text>
+<xsl:text>  oe-layersetup-local-conf-template: |
+</xsl:text>
+<xsl:for-each select='line'>
+<xsl:text>    </xsl:text><xsl:value-of select='text()'/><xsl:text>
+</xsl:text>
+</xsl:for-each>
+<xsl:apply-templates select='/config/local-conf'/>
+<xsl:text>
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
src/xslt/kas.xslt new file +70 -0

70 lines not on this page · raw message

src/xslt/oe-layersetup-templates.xslt new file +25 -0
new file mode 100644
index 0000000..d1dcae5
@@ -0,0 +1,25 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
+
+<xsl:template match="/">
+<xsl:apply-templates select='bblayers-conf-template'/>
+<xsl:apply-templates select='local-conf-template'/>
+</xsl:template>
+
+<xsl:template match='bblayers-conf-template'>
+<xsl:for-each select='line'>
+<xsl:value-of select='text()'/>
+<xsl:text>
+</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match='local-conf-template'>
+<xsl:for-each select='line'>
+<xsl:value-of select='text()'/>
+<xsl:text>
+</xsl:text>
+</xsl:for-each>
+</xsl:template>
+
+</xsl:stylesheet>
src/xslt/oe-layersetup.xslt new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
2.17.1