From: Daan De Meyer Date: Tue, 1 Apr 2025 18:37:52 +0000 (+0200) Subject: Don't allow configuring distribution, release and mirror in tools tree config X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3641%2Fhead;p=thirdparty%2Fmkosi.git Don't allow configuring distribution, release and mirror in tools tree config 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. --- diff --git a/mkosi/config.py b/mkosi/config.py index 0116e625b..3106dd5d4 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -2563,7 +2563,6 @@ SETTINGS: list[ConfigSetting[Any]] = [ choices=Distribution.choices(), help="Distribution to install", scope=SettingScope.universal, - tools=True, ), ConfigSetting( dest="release", @@ -2576,7 +2575,6 @@ SETTINGS: list[ConfigSetting[Any]] = [ default_factory_depends=("distribution",), help="Distribution release to install", scope=SettingScope.universal, - tools=True, ), ConfigSetting( dest="architecture", @@ -2595,7 +2593,6 @@ SETTINGS: list[ConfigSetting[Any]] = [ section="Distribution", help="Distribution mirror to use", scope=SettingScope.universal, - tools=True, ), ConfigSetting( dest="local_mirror", diff --git a/tests/test_config.py b/tests/test_config.py index 2c2621375..e071d0ff0 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1429,9 +1429,6 @@ def test_tools(tmp_path: Path) -> None: (d / "mkosi.tools.conf").write_text( f""" - [Distribution] - Distribution=debian - [Content] PackageDirectories={d} """ @@ -1439,7 +1436,6 @@ def test_tools(tmp_path: Path) -> None: _, tools, _ = parse_config(argv, resources=resources) assert tools - assert tools.distribution == Distribution.debian assert tools.package_directories == [Path(d)] _, tools, _ = parse_config( @@ -1463,4 +1459,4 @@ def test_tools(tmp_path: Path) -> None: _, tools, _ = parse_config(argv, resources=resources) assert tools - assert tools.distribution == Distribution.debian + assert tools.distribution == Distribution.arch