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
"--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]),
if args.verb == Verb.dependencies:
_, [deps] = parse_config(
- ["--directory", "", "--repositories", "", "--include=mkosi-tools", "build"],
+ ["--directory", "", "--repositories", "", *args.cmdline, "--include=mkosi-tools", "build"],
resources=resources,
)
Verb.documentation,
Verb.sysupdate,
Verb.sandbox,
+ Verb.dependencies,
)
def needs_build(self) -> bool:
]
+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")
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]
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",
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]
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
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)}
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,
`mkosi [options…] sandbox [-- command line…]`
+`mkosi [options…] dependencies [-- options…]`
+
`mkosi [options…] clean`
`mkosi [options…] serve`
`mkosi [options…] completion [shell]`
-`mkosi [options…] dependencies`
-
`mkosi [options…] help`
# DESCRIPTION
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.
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.
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
+++ /dev/null
-# 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
--- /dev/null
+# 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
[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
distribution-gpg-keys
dnf5
dnf5-plugins
- qemu-system-aarch64-core
- qemu-system-s390x-core
systemd-ukify
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
+
+[Content]
+Packages=
+ dnf
+ dnf-plugins-core
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Repositories=epel
+Release=9
+
+[Content]
+Packages=
+ btrfs-progs
+ distribution-gpg-keys
+ sbsigntools
--- /dev/null
+# 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
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|debian
+Distribution=|kali
+Distribution=|ubuntu
+
+[Content]
+Packages=
+ debian-archive-keyring
--- /dev/null
+# 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
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=kali
+
+[Content]
+Packages=
+ kali-archive-keyring
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
[Distribution]
Repositories=main,universe
+
+[Content]
+Packages=
+ ubuntu-keyring
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Content]
+Packages=
+ acl
+ attr
+ bash
+ diffutils
+ findutils
+ grep
+ jq
+ less
+ nano
+ sed
+ strace
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
-Distribution=centos
+Distribution=arch
[Content]
Packages=
- dnf
- dnf-plugins-core
+ base
perf
+ git
--- /dev/null
+# 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
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
+
+[Content]
+Packages=
+ perf
--- /dev/null
+# 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
Distribution=|kali
[Content]
-Packages=linux-perf
+Packages=
+ linux-perf
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Content]
+Packages=
+ perf
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+ git-core
+ patterns-base-minimal_base
+ perf
+ systemd-coredump
--- /dev/null
+# 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
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
+Distribution=|centos
+Distribution=|alma
+Distribution=|rocky
+Distribution=|rhel
Repositories=epel
Release=9
Packages=
apt
archlinux-keyring
- btrfs-progs
debian-keyring
distribution-gpg-keys
pacman
- sbsigntools
ubu-keyring
--- /dev/null
+# 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
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=fedora
+
+[Content]
+Packages=
+ apt
+ archlinux-keyring
+ debian-keyring
+ pacman
+ reprepro
+ ubu-keyring
+ zypper
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=opensuse
+
+[Content]
+Packages=
+ dnf5
+ dnf5-plugins
+ reprepro
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Content]
+Packages=
+ socat
+ swtpm
[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
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
--- /dev/null
+# 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
# SPDX-License-Identifier: LGPL-2.1-or-later
[Match]
-HostArchitecture=|x86-64
-HostArchitecture=|arm64
+Architecture=|x86-64
+Architecture=|arm64
[Content]
Packages=
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Distribution=azure
+
+[Content]
+Packages=
+ qemu-system-aarch64-core
+ qemu-system-s390x-core
--- /dev/null
+# 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
[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
qemu-system-s390x-core
qemu-ui-opengl
qemu-ui-sdl
- reprepro
- ubu-keyring
- zypper
--- /dev/null
+# 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
OutputFormat,
SecureBootSignTool,
ShimBootloader,
+ ToolsTreeProfile,
UKIProfile,
Verb,
Verity,
"ToolsTreePrepareScripts": [
"/prepare"
],
+ "ToolsTreeProfiles": [
+ "misc"
+ ],
"ToolsTreeRelease": null,
"ToolsTreeRepositories": [
"abc"
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("/"))],