Skip to contentSkip to conversation

selftest: automatically add the meta-selftest layer

PATCH New Benjamin Esquivel 1 participant 1 message Jan 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftest: automatically add the meta-selftest layer

adding the meta-selftest layer is a small bump you always encounter when you want to run selftest. Adding an automatic procedure to include the layer if it is not yet present.

---
 scripts/oe-selftest | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
scripts/oe-selftest +10 -2
index 120a6c2..b81e58c 100755
@@ -131,8 +131,16 @@ def preflight_check():
         os.chdir(builddir)
 
     if not "meta-selftest" in get_bb_var("BBLAYERS"):
-        log.error("You don't seem to have the meta-selftest layer in BBLAYERS")
-        return False
+        log.warn("meta-selftest layer not found in BBLAYERS, adding it")
+        meta_selftestdir = os.path.join(
+                get_bb_var("BBLAYERS_FETCH_DIR"),
+                'meta-selftest')
+        if os.path.isdir(meta_selftestdir):
+            runCmd("bitbake-layers add-layer %s" %meta_selftestdir)
+        else:
+            log.error("could not locate meta-selftest in:\n%s"
+                    %meta_selftestdir)
+            return False
 
     log.info("Running bitbake -p")
     runCmd("bitbake -p")
Signature · 1 line
2.5.1