]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi-tools: Split off misc, package-manager and runtime profiles 3527/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 19 Feb 2025 11:39:06 +0000 (12:39 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 19 Feb 2025 13:25:26 +0000 (14:25 +0100)
Let's make the dependencies verb a little more flexible by splitting
off various profiles in mkosi-tools, the misc, package-manager and
runtime profiles. The misc profile contains all the useful tools we
install to make sure they're available in scripts. The package manager
contains non-native package managers and related tools. The runtime
profile contains all the tools required to boot images. The regular
configuration now only includes the tools required to build native images
with mkosi.

The default tools tree still includes both the misc, package-manager and
runtime profiles by default but the list of profiles can be changed with
the new ToolsTreeProfiles= setting. The dependencies verb includes neither
profile, but we now allow passing arbitrary settings to the dependency verb
as arguments so that packages from additional profiles can be requested if
needed.

51 files changed:
mkosi.prepare
mkosi/__init__.py
mkosi/config.py
mkosi/resources/man/mkosi.1.md
mkosi/resources/mkosi-tools/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf [deleted file]
mkosi/resources/mkosi-tools/mkosi.conf.d/arch.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/azure-centos-fedora.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-azure-centos-fedora/mkosi.conf with 66% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/azure.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-azure.conf with 75% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/10-epel-10.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf.d/10-epel-10.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/10-epel-9.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf.d/10-epel-9.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/20-epel-packages-10.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf.d/20-epel-packages-10.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/20-epel-packages-9.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/20-erofs-utils.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf.d/20-erofs-utils.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/20-pkcs11-provider.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf.d/20-pkcs11-provider.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/pkcs11-provider.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/pkcs11-provider.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-boot.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-repart.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-repart.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/systemd-ukify.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/systemd-ukify.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/debian.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/fedora/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/fedora/mkosi.conf.d/sbsigntools.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-fedora/mkosi.conf.d/10-uefi.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/kali.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.conf.d/opensuse.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf with 53% similarity]
mkosi/resources/mkosi-tools/mkosi.conf.d/ubuntu.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/05-ubuntu.conf with 72% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/arch.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf with 60% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/azure-centos-fedora.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/centos.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/linux-perf.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/linux-perf.conf with 78% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/fedora.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/opensuse.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/arch.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/centos-epel-packages-9.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf.d/20-epel-packages-9.conf with 74% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/ubuntu-keyring.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/ubuntu-keyring.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/fedora.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/opensuse.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/arch.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-arch.conf with 50% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/azure-centos-fedora/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/azure-centos-fedora/mkosi.conf.d/edk2-ovmf.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-azure-centos-fedora/mkosi.conf.d/10-uefi.conf with 65% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/azure.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf [new file with mode: 0644]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf.d/python3-virt-firmware.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf.d/python3-virt-firmware.conf with 100% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/fedora/mkosi.conf [moved from mkosi/resources/mkosi-tools/mkosi.conf.d/10-fedora/mkosi.conf with 61% similarity]
mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/opensuse.conf [new file with mode: 0644]
tests/test_json.py

index 3c47fc797cee5c734d004f790293fea09978a69d..40a1e2b3d472fad596e895690468349601bd14b3 100755 (executable)
@@ -6,4 +6,4 @@ if [ "$1" = "build" ]; then
     exit 0
 fi
 
-mkosi-chroot "$SRCDIR"/bin/mkosi dependencies | xargs -d '\n' mkosi-install
+mkosi-chroot "$SRCDIR"/bin/mkosi dependencies -- --profile misc,package-manager,runtime | xargs -d '\n' mkosi-install
index 0e0b5cf758bcd55f9910a87dfe2497c1b74128e3..3a92bbb3e570ae0282b8b23f23b8a085d26fe5d8 100644 (file)
@@ -4489,6 +4489,7 @@ def finalize_default_tools(config: Config, *, resources: Path) -> Config:
         "--directory", "",
         "--distribution", str(config.tools_tree_distribution),
         *(["--release", config.tools_tree_release] if config.tools_tree_release else []),
+        *([f"--profile={profile}" for profile in config.tools_tree_profiles]),
         *(["--mirror", config.tools_tree_mirror] if config.tools_tree_mirror else []),
         *([f"--repositories={repository}" for repository in config.tools_tree_repositories]),
         *([f"--sandbox-tree={tree}" for tree in config.tools_tree_sandbox_trees]),
@@ -4945,7 +4946,7 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
 
     if args.verb == Verb.dependencies:
         _, [deps] = parse_config(
-            ["--directory", "", "--repositories", "", "--include=mkosi-tools", "build"],
+            ["--directory", "", "--repositories", "", *args.cmdline, "--include=mkosi-tools", "build"],
             resources=resources,
         )
 
index 263d1377db83ab4995cb2d9519b3eb02ea40ac42..32c847cc5c1410bbf2b14eb511ff6f857f97b5c7 100644 (file)
@@ -96,6 +96,7 @@ class Verb(StrEnum):
             Verb.documentation,
             Verb.sysupdate,
             Verb.sandbox,
+            Verb.dependencies,
         )
 
     def needs_build(self) -> bool:
@@ -593,6 +594,12 @@ class ArtifactOutput(StrEnum):
         ]
 
 
+class ToolsTreeProfile(StrEnum):
+    misc = enum.auto()
+    package_manager = enum.auto()
+    runtime = enum.auto()
+
+
 def expand_delayed_specifiers(specifiers: dict[str, str], text: str) -> str:
     def replacer(match: re.Match[str]) -> str:
         m = match.group("specifier")
@@ -1928,6 +1935,7 @@ class Config:
     tools_tree: Optional[Path]
     tools_tree_distribution: Optional[Distribution]
     tools_tree_release: Optional[str]
+    tools_tree_profiles: list[ToolsTreeProfile]
     tools_tree_mirror: Optional[str]
     tools_tree_repositories: list[str]
     tools_tree_sandbox_trees: list[ConfigTree]
@@ -3360,6 +3368,16 @@ SETTINGS: list[ConfigSetting[Any]] = [
         default_factory=lambda ns: d.default_release() if (d := ns.tools_tree_distribution) else None,
         help="Set the release to use for the default tools tree",
     ),
+    ConfigSetting(
+        dest="tools_tree_profiles",
+        long="--tools-tree-profile",
+        metavar="PROFILE",
+        section="Build",
+        parse=config_make_list_parser(delimiter=",", parse=make_enum_parser(ToolsTreeProfile)),
+        choices=ToolsTreeProfile.values(),
+        default=list(ToolsTreeProfile),
+        help="Which profiles to enable for the default tools tree",
+    ),
     ConfigSetting(
         dest="tools_tree_mirror",
         metavar="MIRROR",
@@ -4033,6 +4051,7 @@ def create_argument_parser(chdir: bool = True) -> argparse.ArgumentParser:
                 mkosi [options…] {b}coredumpctl{e}   [-- command line…]
                 mkosi [options…] {b}sysupdate{e}     [-- command line…]
                 mkosi [options…] {b}sandbox{e}       [-- command line…]
+                mkosi [options…] {b}dependencies{e}  [-- options…]
                 mkosi [options…] {b}clean{e}
                 mkosi [options…] {b}serve{e}
                 mkosi [options…] {b}burn{e}          [device]
@@ -4040,7 +4059,6 @@ def create_argument_parser(chdir: bool = True) -> argparse.ArgumentParser:
                 mkosi [options…] {b}genkey{e}
                 mkosi [options…] {b}documentation{e} [manual]
                 mkosi [options…] {b}completion{e}    [shell]
-                mkosi [options…] {b}dependencies{e}
                 mkosi [options…] {b}help{e}
                 mkosi -h | --help
                 mkosi --version
@@ -5056,6 +5074,7 @@ def summary(config: Config) -> str:
                          Tools Tree: {config.tools_tree}
             Tools Tree Distribution: {none_to_none(config.tools_tree_distribution)}
                  Tools Tree Release: {none_to_none(config.tools_tree_release)}
+                Tools Tree Profiles: {line_join_list(config.tools_tree_profiles)}
                   Tools Tree Mirror: {none_to_default(config.tools_tree_mirror)}
             Tools Tree Repositories: {line_join_list(config.tools_tree_repositories)}
            Tools Tree Sandbox Trees: {line_join_list(config.tools_tree_sandbox_trees)}
@@ -5290,6 +5309,7 @@ def json_type_transformer(refcls: Union[type[Args], type[Config]]) -> Callable[[
         Vmm: enum_transformer,
         list[UKIProfile]: uki_profile_transformer,
         list[ArtifactOutput]: enum_list_transformer,
+        list[ToolsTreeProfile]: enum_list_transformer,
         CertificateSource: certificate_source_transformer,
         ConsoleMode: enum_transformer,
         Verity: enum_transformer,
index ff726c5364d087becdde822baac87280115f2421..ce8a75fc1e22dd6314a2a4ee8fb1d12a5296fdeb 100644 (file)
@@ -30,6 +30,8 @@ mkosi â€” Build Bespoke OS Images
 
 `mkosi [options…] sandbox [-- command line…]`
 
+`mkosi [options…] dependencies [-- options…]`
+
 `mkosi [options…] clean`
 
 `mkosi [options…] serve`
@@ -44,8 +46,6 @@ mkosi â€” Build Bespoke OS Images
 
 `mkosi [options…] completion [shell]`
 
-`mkosi [options…] dependencies`
-
 `mkosi [options…] help`
 
 # DESCRIPTION
@@ -203,6 +203,14 @@ The following command line verbs are known:
     mkosi dependencies | xargs -d '\n' dnf install
     ```
 
+    By default, only the dependencies required to build images with
+    mkosi are shown. Extra tools tree profiles can be enabled to also
+    output the packages belonging to those profiles. For example,
+    running `mkosi dependencies -- --profile runtime` will also output
+    the packages in the runtime profile on top of the regular packages.
+    See the documentation for `ToolsTreeProfiles=` for a list of
+    available profiles.
+
 `help`
 :   This verb is equivalent to the `--help` switch documented below: it
     shows a brief usage explanation.
@@ -1350,6 +1358,18 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
     default, the hardcoded default release in **mkosi** for the distribution
     is used.
 
+`ToolsTreeProfiles=`, `--tools-tree-profile=`
+:   Set the profiles to enable for the default tools tree. Takes a
+    comma-delimited list consisting of `misc`, `package-manager` and
+    `runtime`. By default, all profiles are enabled.
+
+    The `misc` profile contains various useful tools that are handy to
+    have available in scripts. The package manager profile contains
+    package managers and related tools other than those native to the
+    tools tree distribution. The `runtime` profile contains the tools
+    required to boot images in a systemd-nspawn container or in a
+    virtual machine.
+
 `ToolsTreeMirror=`, `--tools-tree-mirror=`
 :   Set the mirror to use for the default tools tree. By default, the
     default mirror for the tools tree distribution is used.
index cd2f8bb0cb18af4f2c0e26abecf2f6c85763cbca..0db2539940767b2563c8554012fea016ecc198ed 100644 (file)
@@ -12,30 +12,17 @@ BuildSources=
 Bootable=no
 SELinuxRelabel=no
 Packages=
-        acl
-        attr
-        bash
         ca-certificates
         coreutils
         cpio
         curl
-        diffutils
         dosfstools
         e2fsprogs
-        findutils
-        grep
-        jq
         keyutils
         kmod
-        less
         mtools
-        nano
         opensc
         openssl
-        sed
-        socat
-        strace
-        swtpm
         systemd
         tar
         util-linux
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/10-debian-kali-ubuntu/mkosi.conf
deleted file mode 100644 (file)
index 9c96f39..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-[Match]
-Distribution=|debian
-Distribution=|kali
-Distribution=|ubuntu
-
-[Content]
-Packages=
-        ?exact-name(distribution-gpg-keys)
-        ?exact-name(grub-pc-bin)
-        ?exact-name(kali-archive-keyring)
-        ?exact-name(virtiofsd)
-        apt
-        archlinux-keyring
-        btrfs-progs
-        createrepo-c
-        debian-archive-keyring
-        dnf
-        erofs-utils
-        git-core
-        grub-common
-        libarchive-tools
-        libcryptsetup12
-        libseccomp2
-        libtss2-dev
-        libnss-resolve
-        libnss-myhostname
-        makepkg
-        openssh-client
-        ovmf
-        pacman-package-manager
-        policycoreutils
-        python3-cryptography
-        python3-pefile
-        qemu-efi-aarch64
-        qemu-system
-        reprepro
-        sbsigntool
-        squashfs-tools
-        swtpm-tools
-        systemd-container
-        systemd-coredump
-        systemd-journal-remote
-        uidmap
-        xz-utils
-        zypper
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/arch.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/arch.conf
new file mode 100644 (file)
index 0000000..ad52ace
--- /dev/null
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=arch
+
+[Content]
+Packages=
+        archlinux-keyring
+        btrfs-progs
+        erofs-utils
+        grub
+        libseccomp
+        pacman
+        pkcs11-provider
+        python-cryptography
+        sbsigntools
+        squashfs-tools
+        systemd-ukify
+        xz
similarity index 66%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-azure-centos-fedora/mkosi.conf
rename to mkosi/resources/mkosi-tools/mkosi.conf.d/azure-centos-fedora.conf
index 6f192ea2eb7be4dcb994622b5b0847e1b6ded543..0a5340a50bfbe06468933a919c7179ac09648df6 100644 (file)
@@ -11,21 +11,12 @@ Distribution=|azure
 [Content]
 Packages=
         createrepo_c
-        git-core
         grub2-tools
         libseccomp
-        openssh-clients
         policycoreutils
         python3-cryptography
         qemu-img
-        qemu-kvm-core
-        shadow-utils
         squashfs-tools
-        swtpm-tools
-        systemd-container
-        systemd-journal-remote
         systemd-udev
         systemd-ukify
-        virt-firmware
-        virtiofsd
         xz
similarity index 75%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-azure.conf
rename to mkosi/resources/mkosi-tools/mkosi.conf.d/azure.conf
index bb30af7067f3a22a19fc94221243eff8d4915623..62baccf8e18156889df1a6eb1cb9fe00fad73a91 100644 (file)
@@ -9,6 +9,4 @@ Packages=
         distribution-gpg-keys
         dnf5
         dnf5-plugins
-        qemu-system-aarch64-core
-        qemu-system-s390x-core
         systemd-ukify
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf
new file mode 100644 (file)
index 0000000..e9c8aaa
--- /dev/null
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
+
+[Content]
+Packages=
+        dnf
+        dnf-plugins-core
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/20-epel-packages-9.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf.d/20-epel-packages-9.conf
new file mode 100644 (file)
index 0000000..1bd96e4
--- /dev/null
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Repositories=epel
+Release=9
+
+[Content]
+Packages=
+        btrfs-progs
+        distribution-gpg-keys
+        sbsigntools
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf
new file mode 100644 (file)
index 0000000..75276f7
--- /dev/null
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|kali
+Distribution=|ubuntu
+
+[Content]
+Packages=
+        ?exact-name(grub-pc-bin)
+        apt
+        btrfs-progs
+        erofs-utils
+        grub-common
+        libarchive-tools
+        libcryptsetup12
+        libseccomp2
+        libtss2-dev
+        policycoreutils
+        python3-cryptography
+        python3-pefile
+        reprepro
+        sbsigntool
+        squashfs-tools
+        xz-utils
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/debian.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/debian.conf
new file mode 100644 (file)
index 0000000..7998af7
--- /dev/null
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|kali
+Distribution=|ubuntu
+
+[Content]
+Packages=
+        debian-archive-keyring
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/fedora/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/fedora/mkosi.conf
new file mode 100644 (file)
index 0000000..523a793
--- /dev/null
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Content]
+Packages=
+        btrfs-progs
+        distribution-gpg-keys
+        dnf5
+        dnf5-plugins
+        erofs-utils
+        pkcs11-provider
diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/kali.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/kali.conf
new file mode 100644 (file)
index 0000000..4b7ee5c
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=kali
+
+[Content]
+Packages=
+        kali-archive-keyring
similarity index 53%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-opensuse.conf
rename to mkosi/resources/mkosi-tools/mkosi.conf.d/opensuse.conf
index a6d9d511d28fb5004024ab6f2616f82ea4b37653..4b380e591e7737f5a2924a95630daa807479bad6 100644 (file)
@@ -9,36 +9,16 @@ Packages=
         ca-certificates-mozilla
         createrepo_c
         distribution-gpg-keys
-        dnf5
-        dnf5-plugins
         erofs-utils
-        git-core
         glibc-gconv-modules-extra
-        grep
         libseccomp2
-        openssh-clients
-        ovmf
-        patterns-base-minimal_base
-        perf
         pkcs11-provider
         policycoreutils
         python3-cryptography
         python3-pefile
-        qemu-headless
-        qemu-ipxe
-        qemu-ovmf-x86_64
-        qemu-uefi-aarch64
-        reprepro
         sbsigntools
-        shadow
         squashfs
-        systemd-boot
-        systemd-container
-        systemd-coredump
         systemd-experimental
-        systemd-journal-remote
         tpm2.0-tools
-        virt-firmware
-        virtiofsd
         xz
         zypper
similarity index 72%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/05-ubuntu.conf
rename to mkosi/resources/mkosi-tools/mkosi.conf.d/ubuntu.conf
index ddde775132479242009563a4f268f137125da793..20dd63c21ccbf34b72c6475d50492aab9ff8fafa 100644 (file)
@@ -5,3 +5,7 @@ Distribution=ubuntu
 
 [Distribution]
 Repositories=main,universe
+
+[Content]
+Packages=
+        ubuntu-keyring
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf
new file mode 100644 (file)
index 0000000..8a0d031
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Content]
+Packages=
+        acl
+        attr
+        bash
+        diffutils
+        findutils
+        grep
+        jq
+        less
+        nano
+        sed
+        strace
similarity index 60%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf
rename to mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/arch.conf
index 93c84ac4f16b79e8d6378b0d5e7cc9c9bb163baf..ac721a3a7ddfe0b63937911306fbbbf8393f3924 100644 (file)
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
 [Match]
-Distribution=centos
+Distribution=arch
 
 [Content]
 Packages=
-        dnf
-        dnf-plugins-core
+        base
         perf
+        git
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/azure-centos-fedora.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/azure-centos-fedora.conf
new file mode 100644 (file)
index 0000000..282c96e
--- /dev/null
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
+Distribution=|fedora
+Distribution=|azure
+
+[Content]
+Packages=
+        git-core
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/centos.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/centos.conf
new file mode 100644 (file)
index 0000000..0618a04
--- /dev/null
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
+
+[Content]
+Packages=
+        perf
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf
new file mode 100644 (file)
index 0000000..30728c2
--- /dev/null
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|kali
+Distribution=|ubuntu
+
+[Content]
+Packages=
+        git-core
+        libnss-resolve
+        libnss-myhostname
+        systemd-coredump
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/fedora.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/fedora.conf
new file mode 100644 (file)
index 0000000..53ac36f
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Content]
+Packages=
+        perf
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/opensuse.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/misc/mkosi.conf.d/opensuse.conf
new file mode 100644 (file)
index 0000000..8e0759b
--- /dev/null
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+        git-core
+        patterns-base-minimal_base
+        perf
+        systemd-coredump
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/arch.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/arch.conf
new file mode 100644 (file)
index 0000000..bebaf2b
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=arch
+
+[Content]
+Packages=
+        apt
+        debian-archive-keyring
+        createrepo_c
+        distribution-gpg-keys
+        dnf
+        dpkg
+        reprepro
+        ubuntu-keyring
+        zypper
similarity index 74%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-centos/mkosi.conf.d/20-epel-packages-9.conf
rename to mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/centos-epel-packages-9.conf
index 3c5c65f3c495ad26e89fcc20d6a9f874f7307cdd..994ac41c673891341885706ded58f02dbcb582af 100644 (file)
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
 [Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
 Repositories=epel
 Release=9
 
@@ -8,9 +12,7 @@ Release=9
 Packages=
         apt
         archlinux-keyring
-        btrfs-progs
         debian-keyring
         distribution-gpg-keys
         pacman
-        sbsigntools
         ubu-keyring
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf
new file mode 100644 (file)
index 0000000..b04a143
--- /dev/null
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|kali
+Distribution=|ubuntu
+
+[Content]
+Packages=
+        ?exact-name(distribution-gpg-keys)
+        ?exact-name(kali-archive-keyring)
+        archlinux-keyring
+        createrepo-c
+        debian-archive-keyring
+        dnf
+        makepkg
+        pacman-package-manager
+        zypper
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/fedora.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/fedora.conf
new file mode 100644 (file)
index 0000000..7e6e10d
--- /dev/null
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Content]
+Packages=
+        apt
+        archlinux-keyring
+        debian-keyring
+        pacman
+        reprepro
+        ubu-keyring
+        zypper
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/opensuse.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/opensuse.conf
new file mode 100644 (file)
index 0000000..3f876c9
--- /dev/null
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+        dnf5
+        dnf5-plugins
+        reprepro
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf
new file mode 100644 (file)
index 0000000..67af4d8
--- /dev/null
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Content]
+Packages=
+        socat
+        swtpm
similarity index 50%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-arch.conf
rename to mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/arch.conf
index ba449a2b775c349a95ee3c1f42c9072ce023755f..0b700aba584d1bac92dfbf9d51f661c6165da957 100644 (file)
@@ -5,27 +5,10 @@ Distribution=arch
 
 [Content]
 Packages=
-        apt
-        archlinux-keyring
-        base
-        btrfs-progs
-        createrepo_c
-        debian-archive-keyring
-        distribution-gpg-keys
-        dnf
-        dpkg
         edk2-ovmf
-        erofs-utils
-        git
-        grub
-        libseccomp
         openssh
-        pacman
-        perf
         pipewire
         pipewire-audio
-        pkcs11-provider
-        python-cryptography
         qemu-audio-pipewire
         qemu-base
         qemu-hw-display-virtio-gpu
@@ -34,13 +17,6 @@ Packages=
         qemu-hw-display-virtio-vga-gl
         qemu-ui-opengl
         qemu-ui-sdl
-        reprepro
-        sbsigntools
         shadow
-        squashfs-tools
-        systemd-ukify
-        ubuntu-keyring
         virt-firmware
         virtiofsd
-        xz
-        zypper
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/azure-centos-fedora/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/azure-centos-fedora/mkosi.conf
new file mode 100644 (file)
index 0000000..69113cd
--- /dev/null
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
+Distribution=|fedora
+Distribution=|azure
+
+[Content]
+Packages=
+        openssh-clients
+        qemu-kvm-core
+        shadow-utils
+        swtpm-tools
+        systemd-container
+        systemd-journal-remote
+        virt-firmware
+        virtiofsd
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/azure.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/azure.conf
new file mode 100644 (file)
index 0000000..d7deda6
--- /dev/null
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=azure
+
+[Content]
+Packages=
+        qemu-system-aarch64-core
+        qemu-system-s390x-core
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf
new file mode 100644 (file)
index 0000000..00eec65
--- /dev/null
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|kali
+Distribution=|ubuntu
+
+[Content]
+Packages=
+        ?exact-name(virtiofsd)
+        openssh-client
+        ovmf
+        qemu-efi-aarch64
+        qemu-system
+        swtpm-tools
+        systemd-container
+        systemd-journal-remote
+        uidmap
similarity index 61%
rename from mkosi/resources/mkosi-tools/mkosi.conf.d/10-fedora/mkosi.conf
rename to mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/fedora/mkosi.conf
index df74b6d47bb470fc3bef59b36abf579dda4a2edd..3c973f8fe9ed6f2ba3a4b0c1d9b5e5152a10b9fb 100644 (file)
@@ -5,17 +5,6 @@ Distribution=fedora
 
 [Content]
 Packages=
-        apt
-        archlinux-keyring
-        btrfs-progs
-        debian-keyring
-        distribution-gpg-keys
-        dnf5
-        dnf5-plugins
-        erofs-utils
-        pacman
-        perf
-        pkcs11-provider
         pipewire
         qemu-audio-pipewire
         qemu-device-display-virtio-gpu
@@ -27,6 +16,3 @@ Packages=
         qemu-system-s390x-core
         qemu-ui-opengl
         qemu-ui-sdl
-        reprepro
-        ubu-keyring
-        zypper
diff --git a/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/opensuse.conf b/mkosi/resources/mkosi-tools/mkosi.profiles/runtime/mkosi.conf.d/opensuse.conf
new file mode 100644 (file)
index 0000000..2773295
--- /dev/null
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+        openssh-clients
+        ovmf
+        qemu-headless
+        qemu-ipxe
+        qemu-ovmf-x86_64
+        qemu-uefi-aarch64
+        shadow
+        systemd-container
+        systemd-journal-remote
+        virt-firmware
+        virtiofsd
index e7d8aac7e3959f96917e731b21d07ace41aeaac1..7bf5ecfd1239da4244f817cfaebdeb3a43277e75 100644 (file)
@@ -34,6 +34,7 @@ from mkosi.config import (
     OutputFormat,
     SecureBootSignTool,
     ShimBootloader,
+    ToolsTreeProfile,
     UKIProfile,
     Verb,
     Verity,
@@ -376,6 +377,9 @@ def test_config() -> None:
             "ToolsTreePrepareScripts": [
                 "/prepare"
             ],
+            "ToolsTreeProfiles": [
+                "misc"
+            ],
             "ToolsTreeRelease": null,
             "ToolsTreeRepositories": [
                 "abc"
@@ -586,6 +590,7 @@ def test_config() -> None:
         tools_tree_package_directories=[Path("/abc")],
         tools_tree_packages=[],
         tools_tree_prepare_scripts=[Path("/prepare")],
+        tools_tree_profiles=[ToolsTreeProfile.misc],
         tools_tree_release=None,
         tools_tree_repositories=["abc"],
         tools_tree_sandbox_trees=[ConfigTree(Path("/a/b/c"), Path("/"))],