From patchwork Wed Oct 16 19:35:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Eatmon X-Patchwork-Id: 50790 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69BBCD2A555 for ; Wed, 16 Oct 2024 19:35:29 +0000 (UTC) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by mx.groups.io with SMTP id smtpd.web10.32016.1729107323541254899 for ; Wed, 16 Oct 2024 12:35:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qkJEDTCu; spf=pass (domain: ti.com, ip: 198.47.23.248, mailfrom: reatmon@ti.com) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 49GJZMop004333; Wed, 16 Oct 2024 14:35:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1729107322; bh=4Y8baEpv3g8moYFcEqKc1mXXndjqvx+Sj/0LxLil+eA=; h=From:To:Subject:Date; b=qkJEDTCukulvphOdgyf47NRSxxSAx15D8uPObb7wVbKN85TH+TNGf2uJHcWL5ndMk DHuJa58yzto8IpSSJPl3rCh8lpCDDcqVVS3no2ry2aIJ7TUu2mWFP99A8qjPOey7z6 LQMXZMmBGDuMoPt5ZsEODXYrdB4kQzjiYjPqQH14= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 49GJZMjG011314 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Oct 2024 14:35:22 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 16 Oct 2024 14:35:22 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 16 Oct 2024 14:35:22 -0500 Received: from uda0214219 (uda0214219.dhcp.ti.com [128.247.81.222]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 49GJZMRR093367; Wed, 16 Oct 2024 14:35:22 -0500 Received: from reatmon by uda0214219 with local (Exim 4.90_1) (envelope-from ) id 1t19nl-0002qL-RH; Wed, 16 Oct 2024 14:35:21 -0500 From: Ryan Eatmon To: Praneeth Bajjuri , Denys Dmytriyenko , Subject: [oe-layersetup][master][RFC] src: New XML/XSLT generation of config files. Date: Wed, 16 Oct 2024 14:35:21 -0500 Message-ID: <20241016193521.9764-1-reatmon@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Oct 2024 19:35:29 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15575 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... Signed-off-by: Ryan Eatmon --- 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 diff --git a/README b/README new file mode 100644 index 0000000..040d308 --- /dev/null +++ b/README @@ -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 + diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..4997038 --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,3 @@ +BBFILE_COLLECTIONS += "oe-layersetup" +LAYERVERSION_oe-layersetup = "1" +LAYERSERIES_COMPAT_oe-layersetup = "kirkstone scarthgap styhead walnascar" diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..f71283a --- /dev/null +++ b/src/Makefile @@ -0,0 +1,284 @@ + +SRC_CONFIGS := $(shell find configs -name "*.xml") +SRC_TEMPLATES := $(shell find templates -name "*.xml") + +TGT_OE_LAYERSETUP_CONFIGS = $(patsubst configs/%,../configs/%,$(patsubst %.xml,%.txt,$(SRC_CONFIGS))) +TGT_OE_LAYERSETUP_TEMPLATES = $(patsubst templates/%,../sample-files/%,$(patsubst %.xml,%.sample,$(SRC_TEMPLATES))) + +TGT_KAS_CONFIGS = $(patsubst configs/%,../kas/%,$(patsubst %.xml,%.yml,$(SRC_CONFIGS))) +TGT_KAS_TEMPLATES = $(patsubst templates/%,../kas/templates/%,$(patsubst %.xml,%.yml,$(SRC_TEMPLATES))) + +TMP_BITBAKE_SETUP_FLATTENED_CONFIGS = $(subst /,_,$(patsubst configs/%,%,$(SRC_CONFIGS))) + +TGT_BITBAKE_SETUP_CONFIGS = $(patsubst %,../bitbake-setup/%,$(patsubst %.xml,%.json,$(TMP_BITBAKE_SETUP_FLATTENED_CONFIGS))) +TGT_BITBAKE_SETUP_TEMPLATES_BBLAYERS_CONF = $(patsubst %,../conf/templates/%,$(patsubst %.xml,%/bblayers.conf.sample,$(TMP_BITBAKE_SETUP_FLATTENED_CONFIGS))) +TGT_BITBAKE_SETUP_TEMPLATES_CONF_NOTES = $(patsubst %,../conf/templates/%,$(patsubst %.xml,%/conf-notes.txt,$(TMP_BITBAKE_SETUP_FLATTENED_CONFIGS))) +TGT_BITBAKE_SETUP_TEMPLATES_CONF_SUMMARY = $(patsubst %,../conf/templates/%,$(patsubst %.xml,%/conf-summary.txt,$(TMP_BITBAKE_SETUP_FLATTENED_CONFIGS))) +TGT_BITBAKE_SETUP_TEMPLATES_LOCAL_CONF = $(patsubst %,../conf/templates/%,$(patsubst %.xml,%/local.conf.sample,$(TMP_BITBAKE_SETUP_FLATTENED_CONFIGS))) +TGT_BITBAKE_SETUP_TEMPLATES = $(TGT_BITBAKE_SETUP_TEMPLATES_BBLAYERS_CONF) \ + $(TGT_BITBAKE_SETUP_TEMPLATES_CONF_NOTES) \ + $(TGT_BITBAKE_SETUP_TEMPLATES_CONF_SUMMARY) \ + $(TGT_BITBAKE_SETUP_TEMPLATES_LOCAL_CONF) + +TARGETS = $(TGT_OE_LAYERSETUP_CONFIGS) \ + $(TGT_OE_LAYERSETUP_TEMPLATES) \ + $(TGT_KAS_CONFIGS) \ + $(TGT_KAS_TEMPLATES) \ + $(TGT_BITBAKE_SETUP_CONFIGS) \ + $(TGT_BITBAKE_SETUP_TEMPLATES) + +all: $(TARGETS) + +clean: + @echo " CLEAN ../kas"; rm -rf ../kas + @echo " CLEAN ../bitbake-setup"; rm -rf ../bitbake-setup + @echo " CLEAN ../conf/templates"; rm -rf ../conf/templates + +vars: + @echo "Source" + @echo "-------------------------" + @echo "SRC_CONFIGS = $(SRC_CONFIGS)" + @echo "SRC_TEMPLATES = $(SRC_TEMPLATES)" + @echo "" + @echo "oe-layersetup" + @echo "-------------------------" + @echo "TGT_OE_LAYERSETUP_CONFIGS = $(TGT_OE_LAYERSETUP_CONFIGS)" + @echo "TGT_OE_LAYERSETUP_TEMPLATES = $(TGT_OE_LAYERSETUP_TEMPLATES)" + @echo "" + @echo "kas" + @echo "-------------------------" + @echo "TGT_KAS_CONFIGS = $(TGT_KAS_CONFIGS)" + @echo "TGT_KAS_TEMPLATES = $(TGT_KAS_TEMPLATES)" + @echo "" + @echo "bitbake-setup" + @echo "-------------------------" + @echo "TGT_BITBAKE_SETUP_CONFIGS = $(TGT_BITBAKE_SETUP_CONFIGS)" + @echo "TGT_BITBAKE_SETUP_TEMPLATES = $(TGT_BITBAKE_SETUP_TEMPLATES)" + @echo "" + @echo "Targets" + @echo "-------------------------" + @echo "TARGETS = $(TARGETS)" + +#------------------------------------------------------------------------------ +# OE-LayerSetup +#------------------------------------------------------------------------------ +define xslt_oe_layersetup = + mkdir -p $(@D); \ + echo " XLST oe-layersetup $*"; \ + xsltproc --xinclude $^ > $@ +endef + +define xslt_oe_layersetup_templates = + mkdir -p $(@D); \ + echo " XLST oe-layersetup-templates $*"; \ + xsltproc --xinclude $^ > $@ +endef + +../configs/%.txt: xslt/oe-layersetup.xslt configs/%.xml + @$(xslt_oe_layersetup) + +../sample-files/%.sample: xslt/oe-layersetup-templates.xslt templates/%.xml + @$(xslt_oe_layersetup_templates) + +#------------------------------------------------------------------------------ +# KAS +#------------------------------------------------------------------------------ +define xslt_kas = + mkdir -p $(@D); \ + echo " XLST kas $*"; \ + xsltproc --stringparam arTemplatePrefix $$loTemplatePrefix --xinclude $^ > $@ +endef + +define xslt_kas_templates = + mkdir -p $(@D); \ + echo " XLST kas-templates $*"; \ + xsltproc --stringparam arTemplatePrefix $$loTemplatePrefix --xinclude $^ > $@ +endef + +../kas/%.yml: xslt/kas.xslt configs/%.xml + @loTemplatePrefix1=`realpath --relative-to configs/$*.xml .`; \ + loTemplatePrefix2=`dirname $${loTemplatePrefix1}`; \ + loTemplatePrefix=`dirname $${loTemplatePrefix2}`; \ + $(xslt_kas) + +../kas/templates/%.yml: xslt/kas-templates.xslt templates/%.xml + @$(xslt_kas_templates) + +#------------------------------------------------------------------------------ +# Bitbake-setup config.json +#------------------------------------------------------------------------------ +define xslt_bitbake_setup = + mkdir -p $(@D); \ + echo " XLST bitbake-setup $*"; \ + xsltproc --stringparam arConfigName $$loConfigName --xinclude $^ > $@ +endef + +../bitbake-setup/%.json: xslt/bitbake-setup.xslt configs/%.xml + @loConfigName="$*"; \ + $(xslt_bitbake_setup) + +../bitbake-setup/amsdk_%.json: xslt/bitbake-setup.xslt configs/amsdk/%.xml + @loConfigName="amsdk_$*"; \ + $(xslt_bitbake_setup) + +../bitbake-setup/coresdk_%.json: xslt/bitbake-setup.xslt configs/coresdk/%.xml + @loConfigName="coresdk_$*"; \ + $(xslt_bitbake_setup) + +../bitbake-setup/glsdk_%.json: xslt/bitbake-setup.xslt configs/glsdk/%.xml + @loConfigName="glsdk_$*"; \ + $(xslt_bitbake_setup) + +../bitbake-setup/mcsdk_%.json: xslt/bitbake-setup.xslt configs/mcsdk/%.xml + @loConfigName="mcsdk_$*"; \ + $(xslt_bitbake_setup) + +../bitbake-setup/processor-sdk_%.json: xslt/bitbake-setup.xslt configs/processor-sdk/%.xml + @loConfigName="processor-sdk_$*"; \ + $(xslt_bitbake_setup) + +../bitbake-setup/processor-sdk-analytics_%.json: xslt/bitbake-setup.xslt configs/processor-sdk-analytics/%.xml + @loConfigName="processor-sdk-analytics_$*"; \ + $(xslt_bitbake_setup) + +../bitbake-setup/processor-sdk-linux_%.json: xslt/bitbake-setup.xslt configs/processor-sdk-linux/%.xml + @loConfigName="processor-sdk-linux_$*"; \ + $(xslt_bitbake_setup) + +#------------------------------------------------------------------------------ +# Bitbake-setup templates +#------------------------------------------------------------------------------ +define xslt_bitbake_setup_templates = + mkdir -p $(@D); \ + echo " XLST bitbake-setup-templates $*"; \ + xsltproc --stringparam arConfigName $$loConfigName --xinclude $^ > $@ +endef + +../conf/templates/%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/%.xml + @loConfigName="$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/amsdk_%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/amsdk/%.xml + @loConfigName="amsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/coresdk_%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/coresdk/%.xml + @loConfigName="coresdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/glsdk_%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/glsdk/%.xml + @loConfigName="glsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/mcsdk_%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/mcsdk/%.xml + @loConfigName="mcsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk_%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/processor-sdk/%.xml + @loConfigName="processor-sdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-analytics_%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/processor-sdk-analytics/%.xml + @loConfigName="processor-sdk-analytics_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-linux_%/bblayers.conf.sample: xslt/bitbake-setup-bblayers-conf.xslt configs/processor-sdk-linux/%.xml + @loConfigName="processor-sdk-linux_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/%.xml + @loConfigName="$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/amsdk_%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/amsdk/%.xml + @loConfigName="amsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/coresdk_%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/coresdk/%.xml + @loConfigName="coresdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/glsdk_%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/glsdk/%.xml + @loConfigName="glsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/mcsdk_%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/mcsdk/%.xml + @loConfigName="mcsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk_%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/processor-sdk/%.xml + @loConfigName="processor-sdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-analytics_%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/processor-sdk-analytics/%.xml + @loConfigName="processor-sdk-analytics_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-linux_%/conf-notes.txt: xslt/bitbake-setup-conf-notes.xslt configs/processor-sdk-linux/%.xml + @loConfigName="processor-sdk-linux_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/%.xml + @loConfigName="$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/amsdk_%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/amsdk/%.xml + @loConfigName="amsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/coresdk_%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/coresdk/%.xml + @loConfigName="coresdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/glsdk_%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/glsdk/%.xml + @loConfigName="glsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/mcsdk_%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/mcsdk/%.xml + @loConfigName="mcsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk_%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/processor-sdk/%.xml + @loConfigName="processor-sdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-analytics_%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/processor-sdk-analytics/%.xml + @loConfigName="processor-sdk-analytics_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-linux_%/conf-summary.txt: xslt/bitbake-setup-conf-summary.xslt configs/processor-sdk-linux/%.xml + @loConfigName="processor-sdk-linux_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/%.xml + @loConfigName="$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/amsdk_%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/amsdk/%.xml + @loConfigName="amsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/coresdk_%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/coresdk/%.xml + @loConfigName="coresdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/glsdk_%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/glsdk/%.xml + @loConfigName="glsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/mcsdk_%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/mcsdk/%.xml + @loConfigName="mcsdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk_%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/processor-sdk/%.xml + @loConfigName="processor-sdk_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-analytics_%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/processor-sdk-analytics/%.xml + @loConfigName="processor-sdk-analytics_$*"; \ + $(xslt_bitbake_setup_templates) + +../conf/templates/processor-sdk-linux_%/local.conf.sample: xslt/bitbake-setup-local-conf.xslt configs/processor-sdk-linux/%.xml + @loConfigName="processor-sdk-linux_$*"; \ + $(xslt_bitbake_setup_templates) + diff --git a/src/bin/check.pl b/src/bin/check.pl new file mode 100755 index 0000000..4b31bbb --- /dev/null +++ b/src/bin/check.pl @@ -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"); + } +} + diff --git a/src/bin/convert.pl b/src/bin/convert.pl new file mode 100755 index 0000000..9f154a4 --- /dev/null +++ b/src/bin/convert.pl @@ -0,0 +1,412 @@ +#!/usr/bin/perl + +use strict; + +# +# This is a one-time script to convert the current oe-layersetup configs into +# the new XML format. Current version only converts kirkstone, scarthgap, and +# master configs. +# +# NOTE: Paths are setup for this script to be run in the src/ directory +# + +my %glReferencedBblayersConf; +my %glReferencedLocalConf; + +convert_configs("configs"); +#convert_templates("../sample-files"); + +foreach my $lpBblayersConf (keys(%glReferencedBblayersConf)) +{ + convert_bblayers_conf_template($lpBblayersConf); +} + +foreach my $lpLocalConf (keys(%glReferencedLocalConf)) +{ + convert_local_conf_template($lpLocalConf); +} + +sub convert_configs +{ + my $arDir = shift; + + #print "convert_configs: $arDir\n"; + + opendir(DIR, "../${arDir}"); + my @loFiles = readdir(DIR); + closedir(DIR); + + foreach my $lpFile (sort {$a cmp $b} @loFiles) + { + next if ($lpFile =~ /^\.\.?$/); + + #print "convert_configs: check: $arDir/$lpFile\n"; + + if (-d "../${arDir}/${lpFile}") + { + convert_configs("${arDir}/${lpFile}"); + } + elsif ($lpFile =~ /\.txt$/) + { + convert_config("${arDir}/${lpFile}"); + } + } +} + +sub convert_config +{ + my $arFile = shift; + + my $loConfigName = $arFile; + $loConfigName =~ s/\.txt$//; + $loConfigName =~ s/configs\///; + + my $loTargetFPFN = $arFile; + $loTargetFPFN =~ s/\.txt$/.xml/; + + my ($loTargetDir) = ($loTargetFPFN =~ /^(.+?)\/[^\/]+$/); + + open(CFG, "../${arFile}"); + my @loLines = ; + close(CFG); + + #------------------------------------------------------------------------- + # Check if the config matches the right branches + #------------------------------------------------------------------------- + my $loMatchBranch = 0; + foreach my $lpLine (@loLines) + { + if ($lpLine =~ /meta-ti/) + { + if ($lpLine =~ /(kirkstone|scarthgap|master)/) + { + $loMatchBranch = 1; + } + + last; + } + } + + if ($loMatchBranch == 0) + { + return; + } + + print "convert: ${arFile} -> ${loTargetFPFN}\n"; + + #------------------------------------------------------------------------- + # Extract the templates so that we can convert them too. + #------------------------------------------------------------------------- + foreach my $lpLine (@loLines) + { + if ($lpLine =~ /^\s*OECORELAYERCONF\s*=\s*(.+?)$/) + { + my $loFile = $1; + + $glReferencedBblayersConf{".".$loFile} = 1; + } + + if ($lpLine =~ /^\s*OECORELOCALCONF\s*=\s*(.+?)$/) + { + my $loFile = $1; + + $glReferencedLocalConf{".".$loFile} = 1; + } + } + + system("mkdir -p ${loTargetDir}"); + + my @loMotd; + my @loLocalConf; + + my $loTargets = "arago"; + + if ($loTargetFPFN =~ /poky/) + { + $loTargets = "poky"; + } + elsif ($loTargetFPFN =~ /distroless/) + { + $loTargets = "distroless"; + } + + my $loDescription = ""; + + if ($loConfigName =~ /^arago-(.+)-config/) + { + my $loBranch = $1; + $loDescription = "Arago reference distribution for $loBranch"; + + if ($loBranch =~ /-next$/) + { + $loDescription .= " (CICD)"; + } + } + elsif ($loConfigName =~ /^poky-(.+)-config/) + { + my $loBranch = $1; + $loDescription = "Poky reference distribution for $loBranch"; + } + elsif ($loConfigName =~ /^distroless-(.+)-config/) + { + my $loBranch = $1; + $loDescription = "Distroless reference for $loBranch"; + } + elsif ($loConfigName =~ /^amsdk\/amsdk-(.+)-config/) + { + my $loVersion = $1; + $loDescription = "TI AMSDK v$loVersion"; + } + elsif ($loConfigName =~ /^coresdk\/coresdk-(.+)-config/) + { + my $loVersion = $1; + $loDescription = "TI CoreSDK v$loVersion"; + } + elsif ($loConfigName =~ /^glsdk\/glsdk-(.+)-config/) + { + my $loVersion = $1; + $loDescription = "TI GLSDK v$loVersion"; + } + elsif ($loConfigName =~ /^mcsdk\/mcsdk-(.+)-config/) + { + my $loVersion = $1; + $loDescription = "TI MCSDK v$loVersion"; + } + elsif ($loConfigName =~ /^processor-sdk\/processor-sdk(?:-(?:dunfell|kirkstone|kirkstone-chromium|scarthgap|scarthgap-chromium))?-(.+?)(-config)?$/) + { + my $loVersion = $1; + $loDescription = "TI Processor SDK v$loVersion"; + } + elsif ($loConfigName =~ /^processor-sdk-analytics\/processor-sdk-analytics-(.+?)(-config)?$/) + { + my $loVersion = $1; + $loDescription = "TI Processor SDK Analytics v$loVersion"; + } + elsif ($loConfigName =~ /^processor-sdk-linux\/processor-sdk(?:-(?:linux|gateway))?-(.+?)(-config)?$/) + { + my $loVersion = $1; + $loDescription = "TI Processor SDK Linux v$loVersion"; + } + + my $loLayerConfTemplate = ""; + my $loLocalConfTemplate = ""; + my $loBitbakeInclusiveVars = "no"; + + my %loBitbake; + my @loRepos; + + foreach my $lpLine (@loLines) + { + chomp($lpLine); + + next if (($lpLine =~ /^#/) && ($lpLine !~/^#\s*meta/)); + next if ($lpLine =~ /^\s*$/); + + if ($lpLine =~ /^OECORELAYERCONF\s*=\s*\.\/sample-files\/(.+?)$/) + { + $loLayerConfTemplate = $1; + $loLayerConfTemplate =~ s/\.sample$/.xml/; + } + elsif ($lpLine =~ /^OECORELOCALCONF\s*=\s*\.\/sample-files\/(.+?)$/) + { + $loLocalConfTemplate = $1; + $loLocalConfTemplate =~ s/\.sample$/.xml/; + } + elsif ($lpLine =~ /^BITBAKE_INCLUSIVE_VARS\s*=\s*(.+?)$/) + { + $loBitbakeInclusiveVars = $1; + } + elsif ($lpLine =~ /^MOTD:\s*(.+?)$/) + { + push(@loMotd, $1); + } + elsif ($lpLine =~ /^LOCALCONF:\s*(.+?)$/) + { + push(@loLocalConf, $1); + } + elsif ($lpLine =~ /^bitbake/) + { + extract_repo(\%loBitbake, $lpLine); + } + elsif ($lpLine =~ /^[^,]+,[^,]+,[^,]+,[^,]+/) + { + my %loRepo; + extract_repo(\%loRepo, $lpLine); + push(@loRepos, \%loRepo); + } + else + { + print "convert_config() - lpLine = $lpLine\n"; + } + } + + + my $loRelSrcDir = $loTargetDir; + $loRelSrcDir =~ s/[^\/\.]/\.\./g; + $loRelSrcDir =~ s/\.+/\.\./g; + + open(XML, ">$loTargetFPFN"); + print XML "\n"; + print XML "\n"; + print XML " ${loDescription}\n"; + print XML "\n"; + if ($#loMotd > -1) + { + print XML " \n"; + } + if (-f "common/targets_${loTargets}.xml") + { + print XML " \n"; + } + print XML " \n"; + print XML " \n"; + print XML "\n"; + print XML " \n"; + print XML "\n"; + print XML " \n"; + + foreach my $lpRepo (@loRepos) + { + print XML " {disabled})) + { + print XML " disabled='$lpRepo->{disabled}'"; + } + print XML ">\n"; + if (exists($lpRepo->{layers})) + { + if ($#{$lpRepo->{layers}} == -1) + { + print XML " \n"; + } + else + { + print XML " \n"; + foreach my $lpLayer (@{$lpRepo->{layers}}) + { + print XML " ${lpLayer}\n"; + } + print XML " \n"; + } + } + print XML " \n"; + } + + print XML " \n"; + print XML "\n"; + if ($#loLocalConf > -1) + { + print XML " \n"; + foreach my $lpLocalConfLine (@loLocalConf) + { + print XML " ${lpLocalConfLine}\n"; + } + print XML " \n"; + print XML "\n"; + } + print XML " \n"; + print XML " \n"; + print XML " \n"; + print XML " \n"; + print XML " \n"; + print XML "\n"; + close(XML); +} + +sub extract_repo +{ + my $rvRepoHash = shift; + my $arLine = shift; + + my ($loRepo, $loUrl, $loBranch, $loCommit, $loLayers) = split(",",$arLine); + + if ($loRepo =~ /^#/) + { + $rvRepoHash->{disabled} = "true"; + $loRepo =~ s/^#//; + } + + $rvRepoHash->{name} = $loRepo; + $rvRepoHash->{url} = $loUrl; + $rvRepoHash->{branch} = $loBranch; + $rvRepoHash->{commit} = $loCommit; + + if ($loLayers) + { + $loLayers =~ s/layers=//; + $rvRepoHash->{layers} = [ split(":",$loLayers) ]; + } +} + +sub convert_local_conf_template +{ + my $arFile = shift; + + my $loTargetFPFN = $arFile; + $loTargetFPFN =~ s/^\.\.\/sample-files/templates/; + $loTargetFPFN =~ s/\.sample$/.xml/; + my ($loTargetFN) = ($loTargetFPFN =~ /^templates\/(.+).xml$/); + + print "convert: ${arFile} -> ${loTargetFPFN}\n"; + + my ($loTargetDir) = ($loTargetFPFN =~ /^(.+?)\/[^\/]+$/); + + system("mkdir -p ${loTargetDir}"); + + open(CFG, $arFile); + my @loLines = ; + close(CFG); + + open(XML, ">$loTargetFPFN"); + print XML "\n"; + + foreach my $lpLine (@loLines) + { + chomp($lpLine); + + $lpLine =~ s/OEBASE/TOPDIR/; + $lpLine =~ s/^MACHINE/#MACHINE/; + + $lpLine =~ s/&/&/g; + $lpLine =~ s//>/g; + + print XML " ${lpLine}\n"; + } + + print XML "\n"; + close(XML); +} + +sub convert_bblayers_conf_template +{ + my $arFile = shift; + + my $loTargetFPFN = $arFile; + $loTargetFPFN =~ s/^\.\.\/sample-files/templates/; + $loTargetFPFN =~ s/\.sample$/.xml/; + my ($loTargetFN) = ($loTargetFPFN =~ /^templates\/(.+).xml$/); + + print "convert: ${arFile} -> ${loTargetFPFN}\n"; + + my ($loTargetDir) = ($loTargetFPFN =~ /^(.+?)\/[^\/]+$/); + + system("mkdir -p ${loTargetDir}"); + + open(CFG, $arFile); + my @loLines = ; + close(CFG); + + open(XML, ">$loTargetFPFN"); + print XML "\n"; + + foreach my $lpLine (@loLines) + { + chomp($lpLine); + print XML " ${lpLine}\n"; + } + + print XML "\n"; + close(XML); +} + diff --git a/src/common/motd_cicd.xml b/src/common/motd_cicd.xml new file mode 100644 index 0000000..95a3ba9 --- /dev/null +++ b/src/common/motd_cicd.xml @@ -0,0 +1,9 @@ + + NOTE: + NOTE: This config is reserved for CI/CD testing and requires manual intervention to build + NOTE: + NOTE: A few SRCREVs in the recipes might refer to commits on cicd/next branches for their + NOTE: repos. These recipes will not build correctly without also a change in your local.conf + NOTE: to point the recipe to the appropriate cicd/next branch for that recipe. + NOTE: + diff --git a/src/common/targets_arago.xml b/src/common/targets_arago.xml new file mode 100644 index 0000000..01d1b55 --- /dev/null +++ b/src/common/targets_arago.xml @@ -0,0 +1,8 @@ + + tisdk-default-image + tisdk-base-image + tisdk-bootstrap-base-image + tisdk-bootstrap-image + tisdk-thinlinux-image + tisdk-tiny-image + diff --git a/src/common/targets_poky.xml b/src/common/targets_poky.xml new file mode 100644 index 0000000..74b89aa --- /dev/null +++ b/src/common/targets_poky.xml @@ -0,0 +1,3 @@ + + core_image_minimal + diff --git a/src/xslt/bitbake-setup-bblayers-conf.xslt b/src/xslt/bitbake-setup-bblayers-conf.xslt new file mode 100644 index 0000000..5db3e0d --- /dev/null +++ b/src/xslt/bitbake-setup-bblayers-conf.xslt @@ -0,0 +1,45 @@ + + + + + + +BBLAYERS ?= " \ + + +" + + + + + + + + + + + + + + ##OEROOT##/../oe-layersetup + + + + + + + + + + ##OEROOT##/..// + + + + + ##OEROOT##/../ + + + + + + diff --git a/src/xslt/bitbake-setup-conf-notes.xslt b/src/xslt/bitbake-setup-conf-notes.xslt new file mode 100644 index 0000000..2dfba81 --- /dev/null +++ b/src/xslt/bitbake-setup-conf-notes.xslt @@ -0,0 +1,32 @@ + + + + + +### Shell environment set up for builds. ### + +You can now run 'bitbake <target>' + +If you have not set MACHINE in your local.conf you can run +'MACHINE=xxxxx bitbake <target>' + +Common targets are: + + + + +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 + + + + + + + + + diff --git a/src/xslt/bitbake-setup-conf-summary.xslt b/src/xslt/bitbake-setup-conf-summary.xslt new file mode 100644 index 0000000..88bbd7a --- /dev/null +++ b/src/xslt/bitbake-setup-conf-summary.xslt @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/xslt/bitbake-setup-local-conf.xslt b/src/xslt/bitbake-setup-local-conf.xslt new file mode 100644 index 0000000..c5c5e60 --- /dev/null +++ b/src/xslt/bitbake-setup-local-conf.xslt @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + +#==================================================================== +# Settings from oe-layersetup config file: +# +# Do not remove. +#-------------------------------------------------------------------- + + + + + +#==================================================================== + + + + diff --git a/src/xslt/bitbake-setup.xslt b/src/xslt/bitbake-setup.xslt new file mode 100644 index 0000000..5385c1f --- /dev/null +++ b/src/xslt/bitbake-setup.xslt @@ -0,0 +1,72 @@ + + + +{ + "version": "1.0", + + "description": "", + + + "configuration": { + "bitbake-setup": { + "default": { + "description": "Default build configuration", + "template": "oe-layersetup-", + "targets": [ "bitbake -k " ] + } + } + } +} + + + + + "sources": { + "oe-layersetup": { + "git-remote": { + "remotes": { + "origin": { + "uri": "https://git.ti.com/git/arago-project/oe-layersetup.git" + } + }, + "rev": "wip" + }, + "path": "oe-layersetup" + }, + "bitbake": { + "git-remote": { + "remotes": { + "origin": { + "uri": "" + } + }, + "rev": "" + }, + "path": "bitbake" + }, + + + }, + + + + + "": { + "git-remote": { + "remotes": { + "origin": { + "uri": "" + } + }, + "rev": "" + }, + "path": "" + } + +, + + + + + + diff --git a/src/xslt/kas-templates.xslt b/src/xslt/kas-templates.xslt new file mode 100644 index 0000000..57277f1 --- /dev/null +++ b/src/xslt/kas-templates.xslt @@ -0,0 +1,38 @@ + + + +header: + version: 17 + + + + + + +bblayers_conf_header: + + oe-layersetup-bblayers-conf-template: | + + + + + + + + + + +local_conf_header: + + oe-layersetup-local-conf-template: | + + + + + + + + + + + diff --git a/src/xslt/kas.xslt b/src/xslt/kas.xslt new file mode 100644 index 0000000..7e1dea4 --- /dev/null +++ b/src/xslt/kas.xslt @@ -0,0 +1,70 @@ + + + +header: + version: 17 + includes: + + + + + +target: + + + + + + + +repos: + + + + + : + + url: "" + + branch: "" + + + commit: "" + + + + + + + + + + layers: + + + : + + + + + + - /templates/.yml + + + + + - /templates/.yml + + + + +local_conf_header: + oe-layersetup-local-conf-config-specific: | + + + + + + + + diff --git a/src/xslt/oe-layersetup-templates.xslt b/src/xslt/oe-layersetup-templates.xslt new file mode 100644 index 0000000..d1dcae5 --- /dev/null +++ b/src/xslt/oe-layersetup-templates.xslt @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/xslt/oe-layersetup.xslt b/src/xslt/oe-layersetup.xslt new file mode 100644 index 0000000..1b51693 --- /dev/null +++ b/src/xslt/oe-layersetup.xslt @@ -0,0 +1,75 @@ + + +# This file takes repo entries in the format +# repo name,repo uri,repo branch,repo commit[,layers=layer1:layer2...:layern] + + + + + + + + + + + +MOTD: + + + + + + + +bitbake,,, + + + + + + + + + + +# +,,, + + + + + +,layers= + +: + + + + + +OECORELAYERCONF=./sample-files/.sample + + + + +OECORELOCALCONF=./sample-files/.sample + + + + + += + + + + + + + +LOCALCONF: + + + + + +