Skip to content

Random thought: two composefs output formats #35

Closed

Description

@allisonkarlitskaya

@cgwalters mentioned something in a meeting today that I wasn't properly thinking about before.

Long story short: by doing the selinux label rewriting which we need to do as installing an unsealed/modified container image, we're effectively already creating a non-normative form of the container image that is only used for booting the system, and not from inside of containers running on the system.

If we're doing that anyway, then to this non-normative boot-only composefs we could make another tweak: remove /boot from the image before we create it, replacing it with an empty directory. That works around our UKI hash recursion issue without getting into weird layer hiding tricks.

Of course, if we're talking about sealed images, then probably we already precomputed our selinux labels already and wrote them into the tar stream and then wrote the "one true" composefs fsverity digest into a label on the image. In that case our hands are substantially more tied. But maybe this idea of splitting out /boot makes sense anyway. We already need to handle /boot resources specially on install, and in the UKI case we have a UEFI signature on the kernel binary (which, in turn, is also signed as part of the overall container image) which becomes the real trust chain for the booted system anyway (ie: we don't check the OCI label on boot). So maybe having a composefs with /boot stripped from it still makes sense even for fully-sealed images.

Activity

  1. allisonkarlitskaya commented on Nov 13, 2024

    @allisonkarlitskaya
    CollaboratorAuthor

    The obvious advantage of this: we could stop thinking about all of these artifact/hidden-composefs-meta-layer hacks. The boot resources would just be in /boot in BLS type 1 or type 2.

  2. cgwalters commented on Nov 13, 2024

    @cgwalters
    Collaborator

    In current bootc standards we don't have anything in /boot - it's the job of the thing deploying the image to copy any data necessary in /boot into the target (a mix of bootc (really libostree) for the kernel, and bootupd for other stuff) and I think this is right. This stuff may be on separate partitions and most importantly if we want to have more than one bootable container installed (and we clearly do) then what's in /boot in the container can't be a source of truth. systemd-boot for example already does this right, the binaries live in /usr and bootctl install copies them and upgrades them etc.

  3. cgwalters commented on Nov 13, 2024

    @cgwalters
    Collaborator

    If we're doing that anyway, then to this non-normative boot-only composefs we could make another tweak: remove /boot from the image before we create it, replacing it with an empty directory. That works around our UKI hash recursion issue without getting into weird layer hiding tricks.

    I am not quite following; we need to "physically" ship the kernel in the container image so it's downloaded to the client system right?

    Isn't this issue just overall a duplicate of #21 ?

  4. allisonkarlitskaya commented on Nov 13, 2024

    @allisonkarlitskaya
    CollaboratorAuthor

    This issue is definitely highly related to #21 but sort of a different direction. I mostly filed it because I wanted to write it down as I was flying out the door so I didn't forget :)

  5. allisonkarlitskaya commented on Apr 2, 2025

    @allisonkarlitskaya
    CollaboratorAuthor

    I'm leaning more and more towards doing this. I'd love to burn down the entire meta-layer concept entirely and just add special handling for anything in /boot (ie: replace it with an empty directory in bootable images). This would dramatically simplify the Containerfile structure for UKI systems.

    The upshot would be that we'd need two fsverity labels: one for containers and one for bootable systems. I think this is a path worth going down, though.

  6. added this to the bootc milestone on Apr 2, 2025
  7. added 2 commits that reference this issue on May 2, 2025
    a589c13
    1ad513c
  8. added a commit that references this issue on May 5, 2025
    a4cbd3e
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions