Stop Rebuilding the Whole OS Image: Practical systemd-sysext and confext on Linux
Описание и применение
Системы с неизменяемыми образами Linux можно быстро расширять, используя systemd-sysext и systemd-confext, которые накладывают OverlayFS‑переопределения на /usr, /opt и /etc без пересборки образа.
Задача
Immutable Linux images make adding a single tool or temporary /etc overlay slow and error‑prone because rebuilding the whole image is required.
Результат
Extensions can be merged and unmerged in seconds, preserving the immutable base image and enabling rapid, reversible changes to /usr, /opt, or /etc.
Рабочий процесс
- Create extension directory under /var/lib/extensions/ or /var/lib/confexts/
- Add an identity file /usr/lib/extension-release.d/extension-release.NAME (or /etc/extension-release.d/extension-release.NAME) matching host os-release
- Place payload files (binaries, scripts, config) in the appropriate hierarchy (e.g., /usr/bin for sysext, /etc/ssh/ for confext)
- Run
sudo systemd-sysext merge(orsystemd-confext merge) to activate the overlay - Verify overlay with
findmnt /usrorsystemd-sysext status - Use
sudo systemd-sysext unmerge(orsystemd-confext unmerge) to revert the change
Доказательства
systemd-sysext and systemd-confext solve a narrower problem cleanly: merge extension images into the live hierarchy with OverlayFS, then unmerge them without rewriting the base OS.
When you merge: systemd finds installed extension images, builds an OverlayFS stack over the host hierarchy, overmounts /usr + /opt (sysext) or /etc (confext).
- Дата записи: 2026-09-22T10:30:28.649Z