(aside from a few exceptions). Use this option to make image builds more reproducible by always using the
same versions of programs to build the final image instead of whatever version is installed on the host
system. If this option is not used, but the `mkosi.tools/` directory is found in the local directory it is
- automatically used for this purpose with the root directory as target.
+ automatically used for this purpose with the root directory as target. Note that when looking up binaries
+ in `--tools-tree=`, only `/usr/bin` and `/usr/sbin` are considered. Specifically, paths specified by
+ `--extra-search-path=` are ignored when looking up binaries in the given tools tree.
### Commandline-only Options
**kwargs: Any,
) -> CompletedProcess:
with bwrap_cmd(root=root, apivfs=apivfs) as bwrap:
+ if root:
+ # If a root is specified, we should ignore any local modifications made to PATH as any of those
+ # tools might not work anymore when /usr is replaced wholesale. We also make sure that both
+ # /usr/bin and /usr/sbin/ are searched so that e.g. if the host is Arch and the root is Debian we
+ # don't ignore the binaries from /usr/sbin in the Debian root.
+ env = dict(PATH="/usr/bin:/usr/sbin") | env
+
try:
result = run([*bwrap, *cmd], text=True, env=env, log=False, **kwargs)
except subprocess.CalledProcessError as e: