Skip to content

Zeglius/sysext-kitchen

Repository files navigation

Sysext-kitchen

What is a "sysext"?

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 and bluefin-nvidia).
  • An alternative to RPM packages in order to apply changes over /usr.

Visual guide Credits to Mathieu Tortuyaux and Timothée Ravier

What is this repo for?

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.

How to...

...build

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

... try an extension...

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

... add/remove packages

See mkosi.images/_dx_base/mkosi.conf.

... add repos

See mkosi.sandbox/etc/yum.repos.d/.

... change the name of the extension

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.

Resources