Skip to content

bootc: allow ignition first boot stage in blueprint#2222

Merged
jbtrystram merged 3 commits intoosbuild:mainfrom
jbtrystram:add_ignition_to_bootc
Feb 27, 2026
Merged

bootc: allow ignition first boot stage in blueprint#2222
jbtrystram merged 3 commits intoosbuild:mainfrom
jbtrystram:add_ignition_to_bootc

Conversation

@jbtrystram
Copy link
Contributor

This allow setting a Firstboot.Ignition.Enable boolean to inject the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46 [1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition

@schutzbot

This comment was marked as resolved.

@supakeen
Copy link
Member

I've done a release of the blueprint library so you can update the dependency here and the option will be available in the code.

@jbtrystram jbtrystram force-pushed the add_ignition_to_bootc branch 2 times, most recently from f0ed2b5 to 21bc18c Compare February 26, 2026 09:27
@supakeen supakeen force-pushed the add_ignition_to_bootc branch from 21bc18c to 0a1ae10 Compare February 26, 2026 09:45
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

Getting there; the errors returned now need to be handled and I see c.GetISO() now also returns an error. That was my mistake as I implemented that but never updated blueprint in images.

I can make a PR or you can fix it in this PR; what do you prefer?

In [1] customizations.GetISO was updated to return an error, handle that

[1] osbuild/blueprint@a072bbf
@jbtrystram
Copy link
Contributor Author

Getting there; the errors returned now need to be handled and I see c.GetISO() now also returns an error. That was my mistake as I implemented that but never updated blueprint in images.

I'll add a commit here :)

@jbtrystram jbtrystram force-pushed the add_ignition_to_bootc branch 2 times, most recently from 57c5090 to 5641cd7 Compare February 26, 2026 11:02
@jbtrystram jbtrystram force-pushed the add_ignition_to_bootc branch 2 times, most recently from 17f3c71 to 7e48e57 Compare February 26, 2026 11:40
@jbtrystram jbtrystram marked this pull request as ready for review February 26, 2026 12:00
@jbtrystram jbtrystram requested a review from a team as a code owner February 26, 2026 12:00
@jbtrystram jbtrystram requested review from bcl, lzap and supakeen February 26, 2026 12:00
@jbtrystram jbtrystram marked this pull request as draft February 26, 2026 12:00
@jbtrystram jbtrystram force-pushed the add_ignition_to_bootc branch 2 times, most recently from d60302c to b0248f0 Compare February 26, 2026 15:24
@jbtrystram
Copy link
Contributor Author

@supakeen I added a second commit here to handle osbuild/osbuild#2149 but it feel quite crudes and does not work. The generated manifest looks correct though, so I am not sure what is happening.

jbtrystram added a commit to jbtrystram/bib-fcos-experimentation that referenced this pull request Feb 26, 2026
This requires a local build of osbuild/images#2222

Then to test:
```
IBC_IMAGE=localhost/ibc
sudo podman build -t localhost/ibc -f Containerfile-ibc

alias ibc='sudo podman run --rm --privileged --network=none -v /var/lib/containers/storage:/var/lib/containers/storage -v ./output:/output -v ./fcos-bp.toml:/fcos-bp.toml $IBC_IMAGE'

ibc build qcow2 \
          --bootc-build-ref $BUILDER_IMAGE \
          --bootc-ref $TARGET_FCOS_IMAGE \
          --output-dir fedora-coreos \
          --output-name fedora-coreos-rawhide \
          --with-buildlog \
          --with-manifest \
          --with-metrics --blueprint /fcos-bp.toml
```
@jbtrystram jbtrystram marked this pull request as ready for review February 27, 2026 08:10
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

Thanks this looks OK to me.

The commits could be redone a bit (e.g. first introduce the blueprint bump + the changes that needs) then a commit to use the new customizations but I won't block on that as it's pretty minor.

}
var err error
// We cannot reuse the existing mounts because the generated ostree mounts are shadowing /boot and the file ends up
// in the wrong place. We reuse the bootupd mount generator as it's enough for this. We just need /boot.
Copy link
Member

Choose a reason for hiding this comment

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

❤️ for adding this in a comment as well.

jbtrystram and others added 2 commits February 27, 2026 14:58
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Note that we specify the target directory to create the
`ignition.firstboot` stamp, as introduced in [2].
This is required because `bootc install to-filesystem` wants an empty
/boot FS, so we need to run the stage after.

We reuse the bootupd mounts generator. We really only need
/boot, so bootupd is probably a bit overkill but does the job.
We cannot reuse the existing mounts here because the `ostree` generated
mounts are shadowing /boot so the file end up in the wrong place.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
[2] osbuild/osbuild#2149

Signed-off-by: jbtrystram <jbtrystram@redhat.com>
Co-authored-by: Simon de Vlieger <cmdr@supakeen.com>
@jbtrystram jbtrystram force-pushed the add_ignition_to_bootc branch from a66cb0c to 4868e5c Compare February 27, 2026 14:08
@jbtrystram
Copy link
Contributor Author

jbtrystram commented Feb 27, 2026

The commits could be redone a bit (e.g. first introduce the blueprint bump + the changes that needs) then a commit to use the new customizations but I won't block on that as it's pretty minor.

I cleaned up the commits :) It was a nice opportunity to practice some git-fu !

@supakeen
Copy link
Member

supakeen commented Feb 27, 2026

The commits could be redone a bit (e.g. first introduce the blueprint bump + the changes that needs) then a commit to use the new customizations but I won't block on that as it's pretty minor.

I cleaned up the commits :) It was a nice opportunity to practice some git-fu !

And you did it so that the diffs didn't change so the approval I gave didn't get dismissed.

If you want, I think you can order the 'update to blueprints 1.25.0' before the ' allow ignition first boot stage' thing.

jbtrystram added a commit to jbtrystram/bib-fcos-experimentation that referenced this pull request Feb 27, 2026
See https://issues.redhat.com/browse/HMS-10227
This requires a local build of osbuild/images#2222

Then to test:
```
IBC_IMAGE=localhost/ibc
sudo podman build -t localhost/ibc -f Containerfile-ibc

alias ibc='sudo podman run --rm --privileged --network=none -v /var/lib/containers/storage:/var/lib/containers/storage -v ./output:/output -v ./fcos-bp.toml:/fcos-bp.toml $IBC_IMAGE'

ibc build qcow2 \
          --bootc-build-ref $BUILDER_IMAGE \
          --bootc-ref $TARGET_FCOS_IMAGE \
          --output-dir fedora-coreos \
          --output-name fedora-coreos-rawhide \
          --with-buildlog \
          --with-manifest \
          --with-metrics --blueprint /fcos-bp.toml
```
Alternatively, use quay.io/jbtrystramtestimages/cosa-ib
@jbtrystram
Copy link
Contributor Author

If you want, I think you can order the 'update to blueprints 1.25.0' before the ' allow ignition first boot stage' thing.

It's already in that order

joelcapitao pushed a commit to joelcapitao/bib-fcos-experimentation that referenced this pull request Feb 27, 2026
See https://issues.redhat.com/browse/HMS-10227
This requires a local build of osbuild/images#2222

Then to test:
```
IBC_IMAGE=localhost/ibc
sudo podman build -t localhost/ibc -f Containerfile-ibc

alias ibc='sudo podman run --rm --privileged --network=none -v /var/lib/containers/storage:/var/lib/containers/storage -v ./output:/output -v ./fcos-bp.toml:/fcos-bp.toml $IBC_IMAGE'

ibc build qcow2 \
          --bootc-build-ref $BUILDER_IMAGE \
          --bootc-ref $TARGET_FCOS_IMAGE \
          --output-dir fedora-coreos \
          --output-name fedora-coreos-rawhide \
          --with-buildlog \
          --with-manifest \
          --with-metrics --blueprint /fcos-bp.toml
```
Alternatively, use quay.io/jbtrystramtestimages/cosa-ib
@supakeen
Copy link
Member

If you want, I think you can order the 'update to blueprints 1.25.0' before the ' allow ignition first boot stage' thing.

It's already in that order

Ah, GitHub UI being silly. Disregard :)

@jbtrystram jbtrystram enabled auto-merge February 27, 2026 14:28
joelcapitao added a commit to joelcapitao/bib-fcos-experimentation that referenced this pull request Feb 27, 2026
@jbtrystram jbtrystram added this pull request to the merge queue Feb 27, 2026
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

This isn't tested anywhere but I trust you tried it already with your own builds. We should add some FCOS manifests to test these things at some point.

@jbtrystram
Copy link
Contributor Author

This isn't tested anywhere but I trust you tried it already with your own builds. We should add some FCOS manifests to test these things at some point.

I'll file something to track this as part of our overall effort of moving to image-builder

Merged via the queue into osbuild:main with commit e5dcc45 Feb 27, 2026
25 checks passed
@jbtrystram jbtrystram deleted the add_ignition_to_bootc branch February 27, 2026 16:06
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.

6 participants