From: Daan De Meyer Date: Sun, 7 Apr 2024 13:58:33 +0000 (+0200) Subject: Mount RuntimeTrees= directory without target to /root/src X-Git-Tag: v23~23^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06096397cf1d2508507ea6430306d5d0fb8c0d85;p=thirdparty%2Fmkosi.git Mount RuntimeTrees= directory without target to /root/src Let's use the same behavior for RuntimeTrees= as we use with BuildSources=. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index a89b70663..0365b8f04 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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 diff --git a/mkosi/qemu.py b/mkosi/qemu.py index 263e85f71..75cb4df76 100644 --- a/mkosi/qemu.py +++ b/mkosi/qemu.py @@ -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): diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index a3f74d4ef..4b08c2474 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -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 diff --git a/mkosi/vmspawn.py b/mkosi/vmspawn.py index ee1701ca0..44ea057d7 100644 --- a/mkosi/vmspawn.py +++ b/mkosi/vmspawn.py @@ -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: