From: Joerg Behrmann Date: Mon, 11 Sep 2023 13:03:33 +0000 (+0200) Subject: tools: add ToolsTreePackages= X-Git-Tag: v17~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1893%2Fhead;p=thirdparty%2Fmkosi.git tools: add ToolsTreePackages= Since we are defaulting to testing for Debian tools trees, we will always fight testing being occasionally broken, e.g. when packages disappear because their newer versions can't transition from unstable. ToolsTreePackages= adds the ability to keep using a default tools tree, but add custom packages on top. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 502ce1a12..c686902fd 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2179,7 +2179,7 @@ def finalize_tools(args: MkosiArgs, presets: Sequence[MkosiConfig]) -> Sequence[ "--incremental", str(p.incremental), "--acl", str(p.acl), "--format", "directory", - *flatten(["--package", package] for package in distribution.tools_tree_packages()), + *flatten(["--package", package] for package in itertools.chain(distribution.tools_tree_packages(), p.tools_tree_packages)), "--output", f"{distribution}-tools", "--bootable", "no", "--manifest-format", "", diff --git a/mkosi/config.py b/mkosi/config.py index 57d480d24..1da591e02 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -714,6 +714,7 @@ class MkosiConfig: tools_tree: Optional[Path] tools_tree_distribution: Optional[Distribution] tools_tree_release: Optional[str] + tools_tree_packages: list[str] # QEMU-specific options qemu_gui: bool @@ -1658,6 +1659,13 @@ SETTINGS = ( parse=config_parse_string, help="Set the release to use for the default tools tree", ), + MkosiConfigSetting( + dest="tools_tree_packages", + metavar="PACKAGE", + section="Host", + parse=config_make_list_parser(delimiter=","), + help="Add additional packages to the tools tree", + ), ) MATCHES = ( diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index f35a9d84d..49f2cc78a 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -1150,6 +1150,12 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, default, the hardcoded default release in mkosi for the distribution is used. +`ToolsTreePackages=`, `--tools-tree-packages=` + +: Extra packages to install into the tools tree. Takes a comma separated list + of package specifications. This option may be used multiple times in which + case the specified package lists are combined. + ## Supported distributions Images may be created containing installations of the following