systemd / mkosi
💽 Build Bespoke OS Images
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing systemd/mkosi in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewmkosi — Build Bespoke OS Images A fancy wrapper around , , and that generates customized disk images with a number of bells and whistles. For a longer description and available features and options, see the man page or run . When getting started see the section. Installation You can install mkosi from your distribution using its package manager or install the development version from git. If you install mkosi using your distribution's package manager, make sure it installs at least mkosi v16 or newer (Use to check). If your distribution only packages an older version of mkosi, it is recommended to install mkosi using one of the alternative installation methods listed below instead. Running mkosi from the repository To run mkosi straight from its git repository, you can invoke the shim . The environment variable can be set when using the shim to configure the python interpreter used to execute mkosi. The shim can be symlinked to e.g. to make it accessible from the . Note that to make this work you might have to add to your user's . mkosi also provides other companion tools that can be enabled in a similar manner. Python installation methods mkosi can also be installed straight from the git repository url using : which will transparently install mkosi into a Python virtual environment and a mkosi binary to . This is, up to the path of the virtual environment and the mkosi binary, equivalent to You can also package mkosi as a zipapp that you can deploy anywhere in your . Running this will leave a binary in Besides the mkosi binary, you can also call mkosi via when not installed as a zipapp. Please note, that the python module exists solely for the usage of the mkosi binary and is not to be considered a public API. Installing packages from upstream repositories mkosi packages for Debian, Ubuntu, Fedora and SUSE are built from latest main and published as repositories for the respective distributions on OBS. Follow these instructions to enable the appropriate repository. kernel-install plugins mkosi can also be used as a kernel-install plugin to build initrds and addons. It is recommended to use only one of these two plugins at a given time. UKI plugin To enable this feature, install into . Extra distro configuration for the initrd can be configured in . Users can add their own customizations in . A full self-contained UKI will be built and installed. Once installed, the mkosi plugin can be enabled by writing and to or to . Addon plugin To enable this feature, install into . Extra distro configuration for the addon can be configured in . Users can add their own customizations in and . Note that unless at least one of the last two directories are present, the plugin will not operate. This plugin is useful to enhance a vendor-provided UKI with local-only modifications. Hacking on mkosi To hack on mkosi itself you will also need mypy, for type checking, and pytest, to run tests. We check tests and typing in CI (see ), but you can run the tests locally as well. References • Primary mkosi git repository on GitHub • A re-introduction to mkosi — A Tool for Generating OS Images • The mkosi OS generation tool story on LWN (2017) • systemd-repart: Building Discoverable Disk Images and mkosi: Building Bespoke Operating System Images talks at All Systems Go! 2023 • Building RHEL and RHEL UBI images with mkosi an article in Fedora Magazine (2023) • Building USIs with mkosi • Constellation 💖 mkosi — Minimal TCB, tailor-made for measured boot • Streamlining kernel hacking with mkosi-kernel • mkosi-initrd: Building initrds out of distribution packages • Running systemd integration tests with mkosi • Arch Linux rescue image with mkosi • Building vagrant images with mkosi • Building images with mkosi on the Open Build Service (OBS) Community Find us on Matrix at #mkosi:matrix.org.