]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Drop MKOSI_NSPAWN_EXECUTABLE 1190/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 Sep 2022 07:01:09 +0000 (09:01 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 Sep 2022 08:15:15 +0000 (10:15 +0200)
Now that --extra-search-paths supports single files, there's no
need anymore for MKOSI_NSPAWN_EXECUTABLE so let's drop it.

mkosi.md
mkosi/__init__.py
mkosi/backend.py

index b5d40ec26e4d4c05ff2cd4c07ea92dd521b7b686..85eb7c9cae1636da6f2839aa86f5a8c0acd750fa 100644 (file)
--- a/mkosi.md
+++ b/mkosi.md
@@ -1275,13 +1275,6 @@ Those settings cannot be configured in the configuration files.
   each build in a series will have a version number one higher then
   the previous one.
 
-### Environment Variables
-
-`MKOSI_NSPAWN_EXECUTABLE`
-
-: Takes a path. If specified, mkosi will use this path as the systemd-nspawn
-  executable instead of the system installation of systemd-nspawn.
-
 ## Supported distributions
 
 Images may be created containing installations of the
index dbf81e46c27a274c2a858b7183b638d14e6e94e6..9efcef65c73bb7763f9c5d22dad6d6ba7cc9269f 100644 (file)
@@ -86,7 +86,6 @@ from .backend import (
     is_centos_variant,
     is_epel_variant,
     is_rpm_distribution,
-    nspawn_executable,
     nspawn_knows_arg,
     nspawn_rlimit_params,
     nspawn_version,
@@ -7236,7 +7235,7 @@ def run_build_script(state: MkosiState, raw: Optional[BinaryIO]) -> None:
         with_network = 1 if state.config.with_network is True else 0
 
         cmdline = [
-            nspawn_executable(),
+            "systemd-nspawn",
             "--quiet",
             target,
             f"--machine=mkosi-{uuid.uuid4().hex}",
@@ -7535,7 +7534,7 @@ def run_shell_cmdline(config: MkosiConfig, pipe: bool = False, commands: Optiona
     else:
         target = f"--image={config.output}"
 
-    cmdline = [nspawn_executable(), "--quiet", target]
+    cmdline = ["systemd-nspawn", "--quiet", target]
 
     if config.read_only:
         cmdline += ["--read-only"]
index 25f024513b01854c90be74955b2d4a2862a88d35..3f6ea56019db4d5d0144bddfb8720931a9f7e3f6 100644 (file)
@@ -673,7 +673,7 @@ def workspace(root: Path) -> Path:
 def nspawn_knows_arg(arg: str) -> bool:
     # Specify some extra incompatible options so nspawn doesn't try to boot a container in the current
     # directory if it has a compatible layout.
-    return "unrecognized option" not in run([nspawn_executable(), arg,
+    return "unrecognized option" not in run(["systemd-nspawn", arg,
                                             "--directory", "/dev/null", "--image", "/dev/null"],
                                             stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, check=False,
                                             text=True).stderr
@@ -692,12 +692,8 @@ def nspawn_rlimit_params() -> Sequence[str]:
     ] if nspawn_knows_arg("--rlimit") else []
 
 
-def nspawn_executable() -> str:
-    return os.getenv("MKOSI_NSPAWN_EXECUTABLE", "systemd-nspawn")
-
-
 def nspawn_version() -> int:
-    return int(run([nspawn_executable(), "--version"], stdout=subprocess.PIPE).stdout.strip().split()[1])
+    return int(run(["systemd-nspawn", "--version"], stdout=subprocess.PIPE).stdout.strip().split()[1])
 
 
 def run_workspace_command(
@@ -710,7 +706,7 @@ def run_workspace_command(
     check: bool = True,
 ) -> CompletedProcess:
     nspawn = [
-        nspawn_executable(),
+        "systemd-nspawn",
         "--quiet",
         f"--directory={state.root}",
         "--machine=mkosi-" + uuid.uuid4().hex,