Skip to content

bootc: extras (partitions) (HMS-11288, HMS-11287) - #2702

Merged
supakeen merged 4 commits into
osbuild:mainfrom
supakeen:extras-bootc
Sep 25, 2026
Merged

supakeen merged 4 commits into
osbuild:mainfrom
supakeen:extras-bootc

Conversation

@supakeen

@supakeen supakeen commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

This is the implementation of the "extras" from #2700 for bootable container based images. It introduces a new extras.yaml in the well-known configuration location, and wires up the necessary helpers and manifest generation for those exports to work.

These extras allow for the production of coupled artifacts when building an image. Specifically in this PR the ability to export partitions separately from the main disk image being produced. This is useful for for example PocketBlue (#2632) where for their Android devices they want the ESP and root partitions separately for flashing.

Usage would look like (for a container that has an extras.yaml looking like):

partitions:
  usr:
    mountpoint: "/usr"
$ image-builder build raw
    --bootc-ref localhost/my-container:latest
    --with-extra partition:usr

We only support partition-type extras for bootable containers (at least initially) as the sysext-type extras are tied to the package sets being installed, in the future we can probably inspect the container for installed packages; or default to always redo the entire transaction but I didn't want to make that decision for this PR.

@supakeen supakeen changed the title bootc: extras (partitions) bootc: extras (partitions) (HMS-11288) Sep 19, 2026
@supakeen

Copy link
Copy Markdown
Member Author

The #2700 branch grew a commit to work with mountpoints inside container type filesystems so I've rebased this one.

@supakeen supakeen changed the title bootc: extras (partitions) (HMS-11288) bootc: extras (partitions) (HMS-11288, HMS-11287) Sep 21, 2026
Recently we landed "extras" support for additional artifacts that can be
produced alongside an image type. I implemented that only for package
based image type definitions.

Add support for reading an `extras.yaml` file from the bootc container's
legacy usr/lib/bootc-image-builder/). This follows the same pattern as
`disk.yaml` and `iso.yaml`.

Only partition extras are supported for `bootc` based image types.
`sysexts` can be considered in the future but they need some work to
figure out how we want to make them nice.

Signed-off-by: Simon de Vlieger <[email protected]>
Fill up partitions on `BootcDiskImage` from the `extras.yaml` read from
a container and wire up the pipeline generation during manifest
creation.

Signed-off-by: Simon de Vlieger <[email protected]>
Propagate the extras all the way so we can implement `Extras()` and
`ExportsWithExtras()`.

Sysext extras are explicitly rejected for bootc images for now.

Signed-off-by: Simon de Vlieger <[email protected]>
Document the usage of `--with-extra` for `bootc` based images in the
source of configuration document.

Signed-off-by: Simon de Vlieger <[email protected]>
@supakeen

Copy link
Copy Markdown
Member Author

This PR has been rebased on top of #2700 and I've merged the variant support in as well so it's ready to be undrafted.

@supakeen
supakeen marked this pull request as ready for review September 21, 2026 20:34
@supakeen
supakeen requested a review from a team as a code owner September 21, 2026 20:34
Comment thread pkg/distro/defs/bootc.go
Comment on lines +175 to +181
for name, p := range osInfo.ExtrasInfo.Partitions {
imgTypeYaml.Extras.Partitions[name] = partitionDef{
Mountpoint: p.Mountpoint,
Filename: p.Filename,
Compression: p.Compression,
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read it right, we're adding the partition extra here onto every bootc image type. But the actual pipeline is only created for disk image types in manifestForDisk, which I suppose makes sense.
If that's the case, could that cause problems somewhere?
Should the combination of partition extra and non-disk types maybe throw an error?

@supakeen supakeen Sep 23, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good question, we don't really have a nice way of scoping down extras only to specific image types at the moment. Some of the other extras might in the future work for non-disk image types.

We don't have this issue on the non-bootc side of things as there they are defined directly on the image type but in the bootc world the container can be any image type.

For me personally this isn't a big enough issue to include a bunch of filtering (containers that can be turned into ISOs are already quite specific and probably wouldn't include an extras.yaml (or disk.yaml) 1) but let's see how others feel about this too (cc @ondrejbudai / @achilleas-k).

We could opt for the simple approach for now as well and deny any extras in manifestForIso.

@lfauster

Copy link
Copy Markdown
Contributor

LGTM, with one small nitty question/finding.

@brlane-rht brlane-rht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@supakeen
supakeen added this pull request to the merge queue Sep 25, 2026
Merged via the queue into osbuild:main with commit f461c61 Sep 25, 2026
54 checks passed
@supakeen
supakeen deleted the extras-bootc branch September 25, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants