This is passed through directly to mkosi. To make this work we also
pass through stdout/stdin directly to the invoked mkosi process.
import os
import platform
import shutil
+import sys
import tempfile
from pathlib import Path
action="store_true",
default=False,
)
+ parser.add_argument(
+ "--debug-shell",
+ help="Turn on debugging output",
+ action="store_true",
+ default=False,
+ )
parser.add_argument(
"--version",
action="version",
if args.debug:
cmdline += ["--debug"]
+ if args.debug_shell:
+ cmdline += ["--debug-shell"]
if os.getuid() == 0:
cmdline += [
# Prefer dnf as dnf5 has not yet officially replaced it and there's a much bigger chance that there will be a
# populated dnf cache directory.
- run(cmdline, env={"MKOSI_DNF": dnf.name} if (dnf := find_binary("dnf", "dnf5")) else {})
+ run(
+ cmdline,
+ stdin=sys.stdin,
+ stdout=sys.stdout,
+ env={"MKOSI_DNF": dnf.name} if (dnf := find_binary("dnf", "dnf5")) else {}
+ )
if __name__ == "__main__":
`--debug=`
: Enable additional debugging output.
+`--debug-shell=`
+: Spawn debug shell in sandbox if a sandboxed command fails.
+
`--version`
: Show package version.