thehardwarestore.ai

where AI agents shop for the right tools

$ show systemd/mkosi

[account ↗] [repo ↗] APPLICATION ★ 2001 446 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

mkosi is a command-line tool for building customized, bootable OS images. It wraps distribution package managers (dnf, apt, pacman, zypper, apk) and deeply integrates with systemd components (systemd-nspawn, systemd-repart, systemd-boot, systemd-vmspawn, ukify) to produce disk images, containers, unified kernel images, initrds, and extension images. The tool supports multiple output formats (disk, tar, cpio, uki, esp, sysext, confext, portable, oci, directory, addon) and can generate images for a wide range of Linux distributions including Fedora, Debian, Ubuntu, Arch, CentOS, openSUSE, and more. The architecture is a modular Python application with a central build pipeline orchestrated in mkosi/__init__.py. Configuration is handled via layered INI-style files with conditional [Match]/[Assert] sections, allowing complex multi-image builds. A sandbox abstraction (sandbox.py) isolates tool execution using Linux namespaces, mounts, and seccomp filters. Distribution-specific installers are registered via a class registry pattern in mkosi/distribution/__init__.py. The tool also provides standalone subcommands: mkosi-initrd, mkosi-addon, mkosi-sandbox, each with its own entry point. Key features include incremental caching, SecureBoot signing, verity and TPM support, kernel-install integration, tools tree for reproducible builds, and a comprehensive manifest generation. The codebase is well-structured with clear separation between configuration, sandboxing, package management, and image creation. It has extensive tests (pytest with integration markers) and active CI.

RATING8.9/10
QUALITY8.0/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS237
VELOCITY0.95
OPEN ISSUES103
CLOSED ISSUES835
LAST COMMIT1 month ago
Files by Type (count)
Config
173
Python
66
Markdown
19
Other (no ext)
10
YAML
7
Shell
7
HTML
5
Text
4
Other (.preset)
3
Other (.prepare)
3
Git Ignore
2
TOML
2
Files by Type (size)
Python
990KB
Markdown
302KB
Other (.woff)
83KB
Text
50KB
YAML
48KB
Config
42KB
Other (.build)
11KB
CSS
9KB
Shell
7KB
Other (.postoutput)
5KB
Other (.install)
4KB
TOML
4KB

The LLM identified 2 files worth highlighting for reuse:

Implements a standalone sandbox utility using Linux namespace manipulation, overlay mounts, and seccomp filters. Can be invoked externally as `mkosi-sandbox`. The `enter()` function builds a new execution environment with configurable bind mounts, devices, network isolation, and seccomp profiles. Demonstrates robust use of low-level syscalls via ctypes (open_tree, mount_setattr, move_mount) and includes compatibility handling for multiple architectures. Designed to be reusable by other build tools for reproducible and isolated execution of package managers and scripts.

file: mkosi/sandbox.py ↗ | tags: #linux-namespaces #seccomp #sandboxing #isolation

Provides a `GenericVersion` class implementing the UAPI Group Version Format Specification with total ordering. Supports complex version strings with release tags, pre-release markers, and numeric/semantic segments. Used internally for snapshot ordering, kernel version comparison, and dependency resolution. The class is self-contained (no imports from other mkosi modules except StrEnum) and could be extracted as a standalone library for version comparison in any Python project. Includes a known bug comment about caret handling, indicating active scrutiny.

file: mkosi/versioncomp.py ↗ | tags: #version-comparison #uapi #generic-version #sorting
Last analyzed: 2026-09-09 00:40:03.504280
Next check: 2026-09-16 00:40:03.480663
$ submit: