A Systemd system extension is a raw image file which contains a
filesystem that can be layered on top of /usr
and /opt
.
This allows us to:
- Extend read-only systems (like Universal Blue) with capabilities like:
- Development tools (vscode, docker, ).
- Build a single extension, for multiple images (per example, an extension can be compatible with
bluefin
andbluefin-nvidia
). - An alternative to RPM packages in order to apply changes over
/usr
.
Credits to Mathieu Tortuyaux and Timothée Ravier
Serves as a tool to build system extensions (be in Github actions, or locally).
Confext (the equivalent for /etc
) is supported as well.
Warning
Confext does not work currently until Systemd v257, wait until the fix arrives.
just setup
IMAGE_REFERENCE="ghcr.io/ublue-os/bazzite"
just prepare-overlay-tar "$IMAGE_REFERENCE"
# The 'dx' can be repaced with any other image from 'mkosi.images/'
mkosi build --dependency dx-sysext
To test an extension temporary (will be deactivated at reboot):
# If its a sysext
sudo mkdir -p /run/extensions
sudo ln -s $PWD/mkosi.output/dx_41_0.1.0.sysext.raw /run/extensions/
sudo systemctl restart systemd-sysext
# Otherwise, if its a confext
sudo mkdir -p /run/confexts
sudo ln -s $PWD/mkosi.output/dx_41_0.1.0.confext.raw /run/extensions/
sudo systemctl restart systemd-confext
If you want to enable it permanently:
# If its a sysext
sudo mkdir -p /var/lib/extensions
sudo cp $PWD/mkosi.output/dx_41_0.1.0.sysext.raw /var/lib/extensions/
sudo systemctl restart systemd-sysext
# Otherwise, if its a confext
sudo mkdir -p /var/lib/confexts
sudo cp $PWD/mkosi.output/dx_41_0.1.0.confext.raw /var/lib/extensions/
sudo systemctl restart systemd-confext
See mkosi.images/_dx_base/mkosi.conf
.
See mkosi.sandbox/etc/yum.repos.d/
.
You can either rename mkosi.images/dx-sysext.conf
and mkosi.images/dx-confext.conf
,
or create a new subimage, see 'Building multiple images' at mkosi documentation
.
- mkosi documentation
- [Content] Section:
- Add packages with
Packages=
. - Add arbitrary files with
SkeletonTrees=
andExtraTrees=
.
- Add packages with
- [Build] Section:
mkosi.sandbox/
andSandboxTrees=
to add files to the builder (like*.repo
files).
- Configuration Settings
- [Content] Section: