sandbox=context.sandbox(
network=True,
options=sources + [
+ # If the cache dir is /var and the workspace directory is /var/tmp (e.g. in mkosi-initrd),
+ # then all the files we mount here might be located in the configured cache directory, so
+ # we have to mount the cache directory first to not override all the other mounts.
+ "--bind", context.cache_dir, context.cache_dir,
"--ro-bind", script, script,
"--ro-bind", cd, cd,
"--bind", context.root, context.root,
- "--bind", context.cache_dir, context.cache_dir,
*finalize_crypto_mounts(tools=context.config.tools()),
"--chdir", Path.cwd(),
],