Skip to content

bootc: support grub2 serial console customization#2403

Open
jbtrystram wants to merge 1 commit into
osbuild:mainfrom
jbtrystram:blueprint_add_bootloader_grub_options
Open

bootc: support grub2 serial console customization#2403
jbtrystram wants to merge 1 commit into
osbuild:mainfrom
jbtrystram:blueprint_add_bootloader_grub_options

Conversation

@jbtrystram

Copy link
Copy Markdown
Contributor

Wire the blueprint bootloader customization into the bootc disk image pipeline.
When blueprint specifies grub2 serial/terminal settings, emit an org.osbuild.grub2.d stage that writes a drop-in config to boot/grub2/console.cfg after bootc install-to-filesystem.

This relies on bootupd's console.cfg grub config: https://github.com/coreos/bootupd/blob/main/src%2Fgrub2%2Fgrub-static-pre.cfg#L41

This adds a Go wrapper for the new osbuild stage and reads GetBootloader() in the bootc image type.

Assisted-by: Opencode.ai <Opus 4.6>
Requires: osbuild/blueprint#53
Requires: osbuild/osbuild#2473

@jbtrystram jbtrystram requested a review from a team as a code owner June 8, 2026 07:46
@jbtrystram jbtrystram force-pushed the blueprint_add_bootloader_grub_options branch 2 times, most recently from 9d7b50c to b1afdd7 Compare June 8, 2026 09:58
@supakeen supakeen self-requested a review June 8, 2026 13:20
@supakeen supakeen marked this pull request as draft June 8, 2026 13:20
@supakeen

supakeen commented Jun 8, 2026

Copy link
Copy Markdown
Member

@jbtrystram I'll mark this one as draft until we land the required osbuild stage in main so we can run CI in a useful manner 🙂

@jbtrystram

jbtrystram commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@supakeen I see the blueprints changes have been released so I guess this can be reviewed ?

I just noticed the image-builder-cli repo merge and haven't built the cli with the new sources so haven't re-tested this since the rebase.

@supakeen

supakeen commented Jul 9, 2026

Copy link
Copy Markdown
Member

@supakeen I see the blueprints changes have been released so I guess this can be reviewed ?

I just noticed the image-builder-cli repo merge and haven't built the cli with the new sources so haven't re-tested this since the rebase.

Yea, you can undraft.

@jbtrystram jbtrystram marked this pull request as ready for review July 9, 2026 05:25
supakeen
supakeen previously approved these changes Jul 9, 2026

@joelcapitao joelcapitao 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.

I tested this PR alongside other PRs I have and got:

============================================================
=== Processing artifact: qemu for x86_64
============================================================
IMAGE_TYPE: qcow2
MEDIA_TYPE: application/vnd.diskimage.qcow2
=== Pre-merged blueprint for qemu ===
name = "Fedora CoreOS"
 
[customizations]
 
[customizations.ignition]
 
[customizations.ignition.firstboot]
empty = true
 
[customizations.kernel]
append = "mitigations=auto,nosmt $ignition_firstboot ignition.platform.id=qemu console=tty0 console=ttyS0,115200n8"
 
[customizations.bootloader]
 
[customizations.bootloader.grub2]
terminal_input = ["serial", "console"]
terminal_output = ["serial", "console"]
serial = "serial --speed=115200"
=== Building qemu disk image ===
Manifest generation step
Building manifest for bootc-based-qcow2
Using disk.yaml root filesystem (xfs), ignoring bootc config (xfs)
Image building step
<stdin> has errors:
 
.pipelines[2].stages[7].options:
  'path' is a required property
 
error: error running osbuild: exit status 2
ERROR: Failed to build qemu

from https://konflux-ui.apps.kflux-fedora-01.84db.p1.openshiftapps.com/ns/coreos-tenant/applications/fedora-coreos-rawhide/pipelineruns/disk-images-rawhide-pull-request-8gbz6

Comment thread pkg/manifest/raw_bootc.go
@jbtrystram jbtrystram force-pushed the blueprint_add_bootloader_grub_options branch from 80612a9 to cb7d8ac Compare July 9, 2026 13:45
@jbtrystram jbtrystram requested a review from supakeen July 9, 2026 13:45
Wire the blueprint bootloader customization into the bootc disk image
pipeline.
When blueprint specifies grub2 serial/terminal settings,
emit an org.osbuild.grub2.d stage that writes a drop-in config to
`boot/grub2/console.cfg` after bootc install-to-filesystem.

This relies on `bootupd`'s `console.cfg` grub config: https://github.com/coreos/bootupd/blob/main/src%2Fgrub2%2Fgrub-static-pre.cfg#L41

This adds a Go wrapper for the new osbuild stage and reads
`GetBootloader()` in the bootc image type.

Assisted-by: Opencode.ai <Opus 4.6>
Requires: osbuild/blueprint#53
Requires: osbuild/osbuild#2473
@jbtrystram jbtrystram force-pushed the blueprint_add_bootloader_grub_options branch from cb7d8ac to 90ca81e Compare July 9, 2026 13:48

@supakeen supakeen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mmm I still had the default path value in my head too :)

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