Skip to contentSkip to conversation

buildsteps: add bblayers modification step

PATCH Superseded Stephano Cetola 1 participant 1 message Jul 27, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildsteps: add bblayers modification step

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 ]

---
 .../autobuilder/buildsteps/ModBBLayersConf.py      | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py
lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py new file +35 -0
new file mode 100644
index 000000000..513e8a15a
@@ -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__ = "[email protected]"
+'''
+
+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)
Signature · 1 line
2.13.3