config_default_repository_key_check() depends on ToolsTreeDistribution=
to select the right default. If the tools tree distribution is configured
in mkosi.tools.conf, we're unable to select the right default for
RepositoryKeyCheck= for the main image. Until we figure out a decent solution
for this, let's insist that the tools tree distribution is configured via
ToolsTreeDistribution=.
Similarly, selecting the default tools tree mirror depends on the selected
target distribution and mirror, so we insist on configuring the tools tree
mirror and release via ToolsTreeMirror= and ToolsTreeRelease= for now.
choices=Distribution.choices(),
help="Distribution to install",
scope=SettingScope.universal,
- tools=True,
),
ConfigSetting(
dest="release",
default_factory_depends=("distribution",),
help="Distribution release to install",
scope=SettingScope.universal,
- tools=True,
),
ConfigSetting(
dest="architecture",
section="Distribution",
help="Distribution mirror to use",
scope=SettingScope.universal,
- tools=True,
),
ConfigSetting(
dest="local_mirror",
(d / "mkosi.tools.conf").write_text(
f"""
- [Distribution]
- Distribution=debian
-
[Content]
PackageDirectories={d}
"""
_, tools, _ = parse_config(argv, resources=resources)
assert tools
- assert tools.distribution == Distribution.debian
assert tools.package_directories == [Path(d)]
_, tools, _ = parse_config(
_, tools, _ = parse_config(argv, resources=resources)
assert tools
- assert tools.distribution == Distribution.debian
+ assert tools.distribution == Distribution.arch