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.
bees (Best-Effort Extent-Same) is a specialized C++ application designed for userspace deduplication on the Btrfs filesystem. It operates as both a CLI tool and a systemd daemon (beesd), scanning filesystem extents to identify duplicate blocks and reclaim space using Btrfs-specific ioctls like BTRFS_IOC_FILE_EXTENT_SAME. The architecture is modular, separating low-level kernel interaction (lib/fs.cc), hash table management (src/bees-hash.cc), and task scheduling (include/crucible/task.h). It prioritizes memory efficiency and incremental scanning to minimize downtime on large filesystems. The system relies heavily on Linux kernel internals, specifically Btrfs tree structures and extent metadata. It implements a custom memory-mapped hash table (BeesHashTable) to persist fingerprint data across restarts, allowing incremental deduplication without rescanning the entire filesystem. Concurrency is managed via a custom TaskMaster that adjusts worker thread counts based on system load, preventing I/O saturation during deduplication operations. While the code demonstrates high craftsmanship in system programming, it carries significant technical debt risks due to its tight coupling with volatile kernel APIs. The project maintains a robust test suite for its utility libraries but relies on integration testing for the core deduplication logic. It is a mature tool for Btrfs administrators but requires careful maintenance as kernel internals evolve.
ChimeraOS is a build system for creating a custom Arch Linux-based operating system image tailored for gaming consoles. It provides a set of shell scripts, configuration files, and GitHub Actions workflows to assemble a complete system image with Steam, RetroArch, gamescope, and other gaming-related packages. The build process uses a Docker container to create a reproducible environment, installs packages from Arch repositories and the AUR, applies custom configurations, and produces a compressed Btrfs image. The repository includes scripts for session management, hardware quirks, and system migrations, all designed to create a console-like experience on PC hardware. It is not a runtime application but a build toolchain, and the code is well-structured for its purpose, with several reusable utility scripts and migration patterns.