[yocto] [yocto-autobuilder][PATCH] buildsteps: add bblayers modification step

Stephano Cetola stephano.cetola at linux.intel.com
Thu Jul 27 09:34:04 PDT 2017


This step is currently only applicable to refkit. It allows us to
replace oe-core and oe-selftest layers in their bblayers.conf with
those layers that we are currently testing.

In the future, we may be able to improve this to replace layer "x"
with layer "y" dynamically, however that presents several challenges
outside the scope of this work.

[YOCTO #11745 ]

Signed-off-by: Stephano Cetola <stephano.cetola at linux.intel.com>
---
 .../autobuilder/buildsteps/ModBBLayersConf.py      | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py

diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py b/lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py
new file mode 100644
index 000000000..513e8a15a
--- /dev/null
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py
@@ -0,0 +1,35 @@
+'''
+Created on July 24, 2017
+
+__author__ = "Stephano Cetola"
+__copyright__ = "Copyright 2017, Intel Corp."
+__credits__ = ["Stephano Cetola"]
+__license__ = "GPL"
+__version__ = "2.0"
+__maintainer__ = "Stephano Cetola"
+__email__ = "stephano.cetola at linux.intel.com"
+'''
+
+from buildbot.steps.shell import ShellCommand
+from twisted.python import log
+
+class ModBBLayersConf(ShellCommand):
+    haltOnFailure = True
+    flunkOnFailure = True
+    name = "Modify BBLayers Configuration"
+    def __init__(self, factory, argdict=None, **kwargs):
+        self.factory = factory
+        for k, v in argdict.iteritems():
+            setattr(self, k, v)
+        self.description = "Modify BBLayers Configuration"
+        ShellCommand.__init__(self, **kwargs)
+
+    def start(self):
+        workdir = self.getProperty("workdir")
+        bblayers = "%s/build/build/conf/bblayers.conf" % workdir
+        yoctodir = "%s/build/meta \\\\" % workdir 
+        selftestdir = "%s/build/meta-selftest \\\\" % workdir
+        cmd1 = "sed -i 's|.*openembedded-core/meta .*|%s|' %s" % (yoctodir, bblayers)
+        cmd2 = "sed -i 's|.*openembedded-core/meta-selftest.*|%s|' %s" % (selftestdir, bblayers)
+        self.command = "%s;%s" % (cmd1, cmd2)
+        ShellCommand.start(self)
-- 
2.13.3




More information about the yocto mailing list