]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Log command line run on qemu 265/head
authorLucas De Marchi <lucas.demarchi@intel.com>
Mon, 8 Oct 2018 23:07:29 +0000 (16:07 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 10 Oct 2018 21:10:55 +0000 (14:10 -0700)
This makes it easier to debug and customize what we are running when
calling qemu. And example customization might be:

sudo mkosi --default mkosi.fedora qemu \
    -drive if=pflash,format=raw,file=myvars.fd

mkosi

diff --git a/mkosi b/mkosi
index b22e4bfe187b506c8a683377d583080ef8242d72..f9b97f97fad150ac6d2deda2059298802d609cd5 100755 (executable)
--- a/mkosi
+++ b/mkosi
@@ -16,6 +16,7 @@ import hashlib
 import os
 import platform
 import re
+import shlex
 import shutil
 import stat
 import string
@@ -148,6 +149,10 @@ def roundup512(x):
 def print_step(text):
     sys.stderr.write("‣ \033[0;1;39m" + text + "\033[0m\n")
 
+def print_running_cmd(cmdline):
+    sys.stderr.write("‣ \033[0;1;39mRunning command:\033[0m\n")
+    sys.stderr.write(" ".join(shlex.quote(x) for x in cmdline) + "\n")
+
 def mkdir_last(path, mode=0o777):
     """Create directory path
 
@@ -3624,6 +3629,8 @@ def run_qemu(args):
                  "-drive", "format=raw,file=" + args.output,
                  *args.cmdline ]
 
+    print_running_cmd(cmdline)
+
     os.execvp(cmdline[0], cmdline)
 
 def expand_paths(paths):