run: sudo mkosi summary
- name: Build tools tree
- run: sudo mkosi -f sandbox -- true
+ run: sudo mkosi -f box -- true
- name: Build image
run: sudo mkosi --distribution ${{ matrix.distro }} -f
- name: Run integration tests
run: |
- sudo mkosi sandbox -- \
+ sudo mkosi box -- \
timeout -k 30 1h \
python3 -m pytest \
--tb=no \
expand_delayed_specifiers,
finalize_configdir,
format_bytes,
- in_sandbox,
+ in_box,
parse_boolean,
parse_config,
resolve_deps,
print_output_size(context.config.output_dir_or_cwd() / context.config.output_with_compression)
-def run_sandbox(args: Args, config: Config) -> None:
- if in_sandbox():
+def run_box(args: Args, config: Config) -> None:
+ if in_box():
die(
- "mkosi sandbox cannot be invoked from within another mkosi sandbox environment",
- hint="Exit the current sandbox environment and try again",
+ "mkosi box cannot be invoked from within another mkosi box environment",
+ hint="Exit the current mkosi box environment and try again",
)
if not args.cmdline:
hd, hr = detect_distribution()
- env = {"MKOSI_IN_SANDBOX": "1"}
+ env = {"MKOSI_IN_BOX": "1"}
if hd:
env |= {"MKOSI_HOST_DISTRIBUTION": str(hd)}
if hr:
Verb.ssh: run_ssh,
Verb.journalctl: run_journalctl,
Verb.coredumpctl: run_coredumpctl,
- Verb.sandbox: run_sandbox,
+ Verb.box: run_box,
+ Verb.sandbox: run_box,
}[args.verb](args, last)
if last.output_format == OutputFormat.none:
dependencies = enum.auto()
completion = enum.auto()
sysupdate = enum.auto()
+ box = enum.auto()
sandbox = enum.auto()
init = enum.auto()
Verb.completion,
Verb.documentation,
Verb.sysupdate,
+ Verb.box,
Verb.sandbox,
Verb.dependencies,
)
def needs_tools(self) -> bool:
- return self in (Verb.sandbox, Verb.journalctl, Verb.coredumpctl, Verb.ssh)
+ return self in (Verb.box, Verb.sandbox, Verb.journalctl, Verb.coredumpctl, Verb.ssh)
def needs_build(self) -> bool:
return self in (
return value
-def in_sandbox() -> bool:
- return parse_boolean(os.getenv("MKOSI_IN_SANDBOX", "0"))
+def in_box() -> bool:
+ return parse_boolean(os.getenv("MKOSI_IN_BOX", "0"))
def parse_path(
return old
if hash := startswith(value, "commit:"):
- if not in_sandbox():
+ if not in_box():
gitdir = Path(__file__).parent.parent
if not (gitdir / ".git").exists():
die("Cannot check mkosi git version, not running mkosi from a git repository")
return self.package_cache_dir or (INVOKING_USER.cache_dir() / "mkosi" / key)
def tools(self) -> Path:
- if in_sandbox():
+ if in_box():
return Path("/")
return self.tools_tree or Path("/")
# Caching the package manager used does not matter for the default tools tree because we don't
# cache the package manager metadata for the tools tree either. In fact, it can cause issues as
# the cache manifest for the tools tree will sometimes be different depending on whether we're
- # running inside or outside of the mkosi sandbox. To avoid these issues, don't cache the package
- # manager used in the tools tree cache manifest.
+ # running inside or outside of the mkosi box environment. To avoid these issues, don't cache the
+ # package manager used in the tools tree cache manifest.
**(
{"package_manager": self.distribution.package_manager(self).executable(self)}
if self.image != "tools"
tools = None
if config.get("tools_tree") == Path("default"):
- if in_sandbox():
+ if in_box():
config["tools_tree"] = Path(os.environ["MKOSI_DEFAULT_TOOLS_TREE_PATH"])
else:
tools = finalize_default_tools(context, config, configdir=configdir, resources=resources)
`mkosi [options…] sysupdate [-- sysupdate settings…]`
-`mkosi [options…] sandbox [-- command line…]`
+`mkosi [options…] box [-- command line…]`
`mkosi [options…] dependencies [-- options…]`
specified after the `sysupdate` verb and separated from the regular
options with `--` are passed directly to **systemd-sysupdate**.
-`sandbox`
-: Run arbitrary commands inside of the same sandbox used to execute
+`box`
+: Run arbitrary commands inside of the same environment used to execute
other verbs such as `boot`, `shell`, `vm` and more. This means
`/usr` will be replaced by `/usr` from the tools tree if one is used
while everything else will remain in place. If no command is provided,
OutputFormat,
Verb,
config_parse_bytes,
- in_sandbox,
+ in_box,
parse_config,
parse_ini,
)
d = tmp_path
argv = ["--tools-tree=default"]
- if in_sandbox():
- pytest.skip("Cannot run test_tools() test within mkosi sandbox environment")
+ if in_box():
+ pytest.skip("Cannot run test_tools() test within mkosi box environment")
with resource_path(mkosi.resources) as resources, chdir(d):
_, tools, _ = parse_config(argv, resources=resources)