Skip to content

frontend for systemd-sysext #7

Open

Description

@cgwalters

Let's add first class support for systemd-sysext - but instead of being DDI oriented we fetch and upgrade them from a registry.

Something like:

$ bootc sysext -M add quay.io/examplecorp/exampleos-debugtools:latest

-M here means to automatically run systemd-sysext merge after the operation. We'd store the sysexts in /var/lib/extensions by default. Other operations:

$ bootc sysext rm <ext>
$ bootc sysext rm --all

These would only remove sysexts that we "own" or write.

Also, bootc upgrade by default should error out if a target sysext is incompatible.


Original issue:

I think it would make sense to support functionality similarly to https://www.freedesktop.org/software/systemd/man/systemd-sysext.html - we could even use that as a backend, though it needs some design around interactions eventually lowering "live apply" type flows.

A strawman could look like:

$ bootc overlay add quay.io/examplecorp/seattle-manufacturing:wifi

That would add a new container image that would be dynamically unioned with the host's rootfs - on updates, we reapply both - and we'd also verify compatibility and fail if e.g. they appeared somehow incompatible. (A lot of potential things to do in "verify compatibility...")

Activity

  1. vrothberg commented on May 31, 2024

    @vrothberg
    Contributor

    Going through old issues at the moment.

    @cgwalters, do you still think dynamic overlays like that make sense? Do you have a concrete use case or user story in mind?

  2. changed the title [-]dynamic overlays[/-] [+]frontend for systemd-sysext[/+] on Sep 30, 2024
  3. cgwalters commented on Sep 30, 2024

    @cgwalters
    MemberAuthor

    @cgwalters, do you still think dynamic overlays like that make sense?

    Yes definitely, I've retitled and retargeted this issue to be explictly about a bootc/container-native frontend to sysext, which has a ton of use cases.

  4. cgwalters commented on Sep 30, 2024

    @cgwalters
    MemberAuthor
  5. dustymabe commented on Sep 30, 2024

    @dustymabe

    Let's add first class support for systemd-sysext - but instead of being DDI oriented we fetch and upgrade them from a registry.

    Also, bootc upgrade by default should error out if a target sysext is incompatible.

    These two things I think have a lot of overlap with the logically bound container images. Do you see this maybe re-using some of the same mechanisms for delivery/binding?

  6. cgwalters commented on Sep 30, 2024

    @cgwalters
    MemberAuthor

    These two things I think have a lot of overlap with the logically bound container images. Do you see this maybe re-using some of the same mechanisms for delivery/binding?

    LBIs themselves overlap with the host storage, which gets into #20

    Clearly all of these things should be stored/managed consistently. sysexts are designed in a relatively simple way where any tool can just drop things in specified directories, but I think for bootc-managed ones we likely want something more "immutable" (API driven, behind readonly bind mount).

  7. p5 commented on Jan 15, 2025

    @p5
    Contributor

    Been thinking about this after I've started using Bootc more at work.

    While having integrations with System Extensions would be pretty cool, I feel it would also be good to have a generic overlay, rather than being tied into a sysext (or maybe this would be a different issue). The main limitation, though it may be a misunderstanding, is that sysexts only work for /usr/, and you need to use confexts - a separate tool - for managing /etc.

    I'm now working in a multi-cloud and on-prem environment, and would love to be able to create a single set of vendor-agnostic images, then be able to tell Bootc to layer/overlay additional scratch images on top to apply the cloud vendor specific configurations. These overlays would apply to the same directories that bootc supports deploying to (all except /var?).

    AWS have their own ssm-agent and ec2 tools they recommend (and require for some functionality). So does Vmware. And Azure environments probably have something else.

    I would like to be able to do the following:

    $ bootc switch my-registry.org/bootc/httpd --overlay my-registry.org/bootc-layers/aws
    $ bootc switch my-registry.org/bootc/httpd --overlay my-registry.org/bootc-layers/vmware
    $ bootc switch my-registry.org/bootc/httpd --overlay my-registry.org/bootc-layers/azure

    This deploys the httpd image as usual, but overlays the contents of the aws "layer" on top of the deployed filesystem, without the need to setup additional pipelines and storage. This layer contains any and all binaries or configuration files required to adapt the OS for that deployment.

    In more simple cases, these overlays could include the applications themselves (although the recommendation would still to use Quadlets/containers/LBIs):

    $ bootc switch my-registry.org/bootc/rhel --overlay my-registry.org/bootc-layers/httpd
    

    A bootc update would update both the system image and overlay images, and allow you to target mutable tags.

    Bootc Image Builder would be used to create these cloud-specific images with the required overlays for each platform.

  8. antheas commented on Jul 9, 2025

    @antheas
    Contributor

    Will just drop here and say that I am a fan of the syntax that Colin suggests in the beginning:

    bootc sysext -M add quay.io/examplecorp/exampleos-debugtools:latest
    

    I would mix it up and do the following though, for example (what @p5 said but ext is prettier and shorter I guess):

    sudo bootc switch gchr.io/ublue-os/bazzite --ext dx --ext asus --ext nvidia
    

    Where how it would work is that bootc would first pull the manifest of gchr.io/ublue-os/bazzite to get the version tag, then convert the extensions to their full location: gchr.io/ublue-os/bazzite:<tag>-<ext> e.g., ghcr.io/ublue-os/bazzite:20250605.1-dx. Or, --ext can take a full URI.

    In this case an extension to a multi-layer oci tar ball with the files that should be layered/removed, which is essentially a sysext

    Then it can pull and stitch everything together to deploy a solid composefs deployment with verity. A syntax like this is nice and solves a lot of issues we'd face with sysexts, such as merging etc and rollbacks, as bootc already features a mature mechanism for those.

    Ostree also already features support for composite commits (it is what rpm-ostree uses for rpms), and bootc already has support for pulling bound images, so from an implementation perspective something like this would be quite small (would be mix and match). And the runtime/storage penalty for this would be zero, as it uses the current stack.

    From a backend perspective there would be some work to be done on the ostree-ext side, but it would not take a lot of effort to add treeshaking support to Rechunk and a modification to the ostree-ext input schema to produce images with subsets of files. Extensions could also be produced with from scratch + copy <from> and then rechunked with either the upstream or downstream variant, but I do not know how good of a DX that is.

    The hardest part in this would be composefs support, as calculating the composefs blob hash of arbitrary extensions combinations is not possible ahead of time, so a small merge would have to be done in e.g., the initramfs with an ephemeral key trusted by the kernel, or you'd have to stack multiple composefs blobs together in the overlay with a perf degradation.

    Seems stacking multiple devices is in the EROFS standard though, so perhaps its not as much work is needed. The initramfs in this case would just build the EROFS meta in memory, enroll the signing keys of the extensions to the TPM PCRs, and then trust it.
    https://erofs.docs.kernel.org/en/latest/merging.html

    Live updates could just overlay mount the composefs blob of the extension (sudo bootc usroverlay --ext dx perhaps?).

  9. antheas commented on Jul 9, 2025

    @antheas
    Contributor

    We can also make the extensions ostree commits if that would help with the deployment time with a fallback to re-deployment as currently happens in rpm-ostree.

    If the image manifest is uploaded last and we go through the treeshaking route with rechunk, we also get the benefit that if the user only uses premade extensions by the image vendor, they get to update as soon as the image is live, instead of waiting for the extensions to upload. Which is another hurdle with sysext.

    We can also play with the --ext syntax a bit so extensions that do not need to match 100% to the container do not need to be rebuilt. Perhaps if : is included in the beginning then the whole tag instead of doing replacement, e.g., :stable-debug or :debug for debugging tools.

    The manifest could also include the replacement rules in it, e.g., dev.bootc.deployment.ext.pattern: "ghcr.io/ublue-os/bazzite-<ext>:<version>" if we wanted each extension to go to a separate repo, or "ghcr.io/ublue-os/bazzite-ext:stable-<ext>" if we want all extensions together to be in a separate repo than the image and not be rebuilt every update. It could also have extension aliases, so dx could map to a URI ( dev.bootc.deployment.ext.alias: "{\"dx\": \"ghcr.io/ublue-os/bazzite-dx:<version>\", \"asus\": \"...\"}")

  10. daegalus commented on Sep 19, 2025

    @daegalus

    I am still somewhat new to the bootc world and how it all functions, so apologies if I misunderstood something.

    Recently, I have been helping with Bluefin stuff, specifically Bluefin LTS and I am trying to minimize image variants, like many such efforts across the ublue-os spectrum. And one of those is things like docker/incus etc for DX images, and Nvidia drivers.

    I can move a lot of things to a brew tap as casks, which we already are having great success with. But various issues with containerd, or some of the limtiations with docker rootlesskit make it extremely hard to pull off a brew for Docker. Many similar issues with Incusd also.

    Now, I decided to explore sysexts, since i have used them a bit for 1password in the past (switched to the brew cask as soon as we made it) and a few other things. They seemed like a good place for Docker and Incus, but I was being constantly informed about the issues with sysext there.

    Being a devops engineer in the current landscape, im fairly familiar with how images work and are designed, and was wondering why we havent done more with just the core features of that, which sysext does for the most part.

    Sorry for the long preface, but wanted to provide context on why I am suddenly responding here. After reading through this, I like p5's idea to decouple from sysexts, and just focus on the core fundamentals, and then I agree with pretty much everything antheas mentioned.

    Long story short, I think there is potential to add something similar to sysext to bootc, that isn't sysext, that can solve a lot of issues and get us to where most ublue-os images want to be: 1 or 2 images, and most drivers/hardware variants/tools are just images layered ontop.

    Especially if we can have runtime layering that works right away, and then when someone reboots it just acts as normal being part of the stack of base image + extension layers.

    I still need more time to learn bootc, so even if I would love to just start contributing, I am still not familiar with all the inner workings, gotchyas, etc to contribute. But I am interested and might if nothing happens in a month or 2 with this effort.

    Maybe we should spin this issue off into a different issue/spike on figuring out a bootc way of doing this, and seeing if sysexts are really needed, or if we can do something more fine-tuned.

  11. jcpunk commented on Oct 2, 2025

    @jcpunk

    My thinking is, if sysext doesn't meet our needs we might be better off trying to get the systemd folks to adjust them for our workflows rather than developing a local solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions