[elbe-devel] [PATCH 2/6] initvm: add --build-sdk option

Torben Hohn torben.hohn at linutronix.de
Wed May 29 16:34:07 CEST 2019


to build an sdk it was required to use elbe control.
Add support to build the sdk using initvm highlevel commands.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/commands/initvm.py |  7 +++++++
 elbepack/initvmaction.py    | 24 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/elbepack/commands/initvm.py b/elbepack/commands/initvm.py
index eeb5a1e6b..7e1eeb761 100644
--- a/elbepack/commands/initvm.py
+++ b/elbepack/commands/initvm.py
@@ -66,6 +66,13 @@ def run_command(argv):
         help="allow initvm to support nested kvm. "
              "This makes /proc/cpuinfo inside initvm differ per host.")
 
+    oparser.add_option(
+        "--build-sdk",
+        dest="build_sdk",
+        action="store_true",
+        default=False,
+        help="Also make 'initvm submit' build an SDK.")
+
     PreprocessWrapper.add_options(oparser)
 
     (opt, args) = oparser.parse_args(argv)
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index c7a2b66a7..25af1d3f7 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -296,6 +296,30 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
     print("")
     print("Build finished !")
     print("")
+
+    if opt.build_sdk:
+        try:
+            system(
+                '%s control build_sdk "%s" %s' %
+                (elbe_exe, prjdir, build_opts))
+        except CommandError:
+            print("elbe control build_sdk Failed", file=sys.stderr)
+            print("Giving up", file=sys.stderr)
+            sys.exit(20)
+
+        print("SDK Build started, waiting till it finishes")
+
+        try:
+            system('%s control wait_busy "%s"' % (elbe_exe, prjdir))
+        except CommandError:
+            print("elbe control wait_busy Failed", file=sys.stderr)
+            print("Giving up", file=sys.stderr)
+            sys.exit(20)
+
+        print("")
+        print("SDK Build finished !")
+        print("")
+
     try:
         system(
             '%s control dump_file "%s" validation.txt' %
-- 
2.11.0




More information about the elbe-devel mailing list