Build system extensions for live systemd-sysupdate managed systems using mkosi
Usage: overlay-ext [OPTIONS]
Options:
-f, --force Whether to forceably rebuild the overlay for the booted deployment
-h, --help Print help
-V, --version Print version
Warning
This program is very early in development and will probably not work for most systems.
This program is designed to build a system extension containing additional packages built against the same snapshot as the base system. It is intended primarily for image-based systems managed by systemd-sysupdate.
The actual sysext builds are handled by mkosi and the end user can configure which packages are included at /etc/overlay-ext/mkosi/, which acts as a fully-featured mkosi directory.
When building the sysext with mkosi, the following template is used: overlay-ext-skeleton.
Some systems may require os-specific hacks. Currently only implemented for Arch Linux with a custom db path of /usr/lib/sysimage/lib/pacman, but can be adapted to other distributions by matching os-release files.
In order to use this tool, the following requirements must be met by the system:
-
The system is installed and updated via
systemd-sysupdate, and installed/usrtrees are located on physical partitions. Loopback files may be supported at some point, but are not currently. -
The package database is included on the image. This also means that if the package manager does not put it in
/usr, it must be copied there. -
The image is built against a fixed snapshot, e.g. the Arch Linux Archive. This is achieved in
mkosiusing the configuration optionSnapshot= -
In
/etc/os-release,VERSION_IDis populated and updated every single image version. I may change this toSYSEXT_LEVELlater for better support for Fedora. -
In
/etc/os-release, a custom fieldIMAGE_SNAPSHOTis set to a validmkosisnapshot reference, either grabbed from the build itself or replicated to be what it would be if using another buildsystem (typically this would beYYYY/MM/DD)
Note that the system need not contain a package manager, but mkosi will delete package metadata by default if the package manager is not included on the final image.