]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Mount RuntimeTrees= directory without target to /root/src
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 7 Apr 2024 13:58:33 +0000 (15:58 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 7 Apr 2024 18:30:47 +0000 (20:30 +0200)
Let's use the same behavior for RuntimeTrees= as we use with
BuildSources=.

mkosi/__init__.py
mkosi/qemu.py
mkosi/resources/mkosi.md
mkosi/vmspawn.py

index a89b706632afea2122264b144a9b0d0bc8acc753..0365b8f0451d773ec0d90438032251b4d2c3b00e 100644 (file)
@@ -3852,7 +3852,7 @@ def run_shell(args: Args, config: Config) -> None:
             cmdline += ["--image", fname]
 
         for tree in config.runtime_trees:
-            target = Path("/root/src") / (tree.target or tree.source.name)
+            target = Path("/root/src") / (tree.target or "")
             # We add norbind because very often RuntimeTrees= will be used to mount the source directory into the
             # container and the output directory from which we're running will very likely be a subdirectory of the
             # source directory which would mean we'd be mounting the container root directory as a subdirectory in
index 263e85f71f588ef1d050519a078135f48f1a3c66..75cb4df7602f25c0f934b57b295446cf5bfae0cf 100644 (file)
@@ -960,7 +960,7 @@ def run_qemu(args: Args, config: Config) -> None:
                 "-chardev", f"socket,id={sock.name},path={sock}",
                 "-device", f"vhost-user-fs-pci,queue-size=1024,chardev={sock.name},tag={tag}",
             ]
-            target = Path("/root/src") / (tree.target or tree.source.name)
+            target = Path("/root/src") / (tree.target or "")
             kcl += [f"systemd.mount-extra={tag}:{target}:virtiofs"]
 
         if want_scratch(config) or config.output_format in (OutputFormat.disk, OutputFormat.esp):
index a3f74d4ef8036cbc07a4b5dc0e97f5a2637f2a04..4b08c2474712e0d3097e3c12898eb3da68abf530 100644 (file)
@@ -1777,7 +1777,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
   directory to mount into any machine (container or VM) started by
   mkosi. The second path refers to the target directory inside the
   machine. If the second path is not provided, the directory is mounted
-  below `/root/src` in the machine. If the second path is relative, it
+  at `/root/src` in the machine. If the second path is relative, it
   is interpreted relative to `/root/src` in the machine.
 
 : For each mounted directory, the uid and gid of the user running mkosi
index ee1701ca04c59eb3fddf023a04ba148169d47812..44ea057d77e053e6100655567d9f803b44b2b204 100644 (file)
@@ -78,7 +78,7 @@ def run_vmspawn(args: Args, config: Config) -> None:
         apply_runtime_size(config, fname)
 
         for tree in config.runtime_trees:
-            target = Path("/root/src") / (tree.target or tree.source.name)
+            target = Path("/root/src") / (tree.target or "")
             cmdline += ["--bind", f"{tree.source}:{target}"]
 
         if kernel: