Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overlay.d: add 40grub overlay #2769

Merged

Conversation

dustymabe
Copy link
Member

bootupd upstream was modified to store default static grub configs and allow for OS integrators to add their own snippets by placing files in /usr/lib/bootupd/grub2-static/configs.d/ [1] When we move to building with osbuild we will start taking advantage of this functionality and calling bootupd with --with-static-configs. Let's go ahead and add our snippets here so they can be leveraged when we start calling bootupd with --with-static-configs.

The snippets added here come from the parts of the config currently defined in coreos-assembler that weren't lifted into bootupd [2][3][4].

[1] coreos/bootupd#543
[2] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L58-L60
[3] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L71-L85
[4] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L87-L91

dustymabe added a commit to dustymabe/coreos-installer that referenced this pull request Dec 15, 2023
Upstream we are starting to use grub configs that are partially
baked into bootupd [1] and partially baked into the image via
the OS vendor (in our case a grub2/50_coreos.cfg file [2]). Let's
look first to see if grub2/50_coreos.cfg exists when trying to
write new console settings before falling back to grub2/grub.cfg.

[1] coreos/bootupd#543
[2] coreos/fedora-coreos-config#2769
dustymabe added a commit to dustymabe/coreos-installer that referenced this pull request Dec 15, 2023
Upstream we are starting to use grub configs that are partially
baked into bootupd [1] and partially baked into the image via
the OS vendor (in our case a grub2/50_coreos.cfg file [2]). Let's
look first to see if grub2/50_coreos.cfg exists when trying to
write new console settings before falling back to grub2/grub.cfg.

[1] coreos/bootupd#543
[2] coreos/fedora-coreos-config#2769

# Determine if this is a first boot and set the ${ignition_firstboot} variable
# which is used in the kernel command line.
set ignition_firstboot=""
Copy link
Member

Choose a reason for hiding this comment

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

See coreos/ignition@f878c9d

(Remember because IoT/Edge exist and currently use osbuild this drives us to ship stuff like this in packages)

I think what hasn't happened yet is to ship that content in an ignition-grub subpackage.

Copy link
Member

Choose a reason for hiding this comment

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

Tangentially related to this...we are currently leaving the functionality of coreos-installer --console on the floor in other paths (Anaconda, bootc install).

Maaybe we should try to move this to bootupd, like bootupd sync-bootloader-kargs that uses the kernel cmdline as source of truth and syncs it to /boot/grub2/console.cfg or something.

Copy link
Member Author

Choose a reason for hiding this comment

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

See coreos/ignition@f878c9d

(Remember because IoT/Edge exist and currently use osbuild this drives us to ship stuff like this in packages)

I think what hasn't happened yet is to ship that content in an ignition-grub subpackage.

oh nice - I didn't know that. Yeah, we'd need an ignition-grub subpackage included, but maybe since the path is /usr/lib/bootupd/grub2-static/configs.d/ maybe ignition-bootupd-grub-config subpackage?

We can easily switch out this to use that when it has shipped.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tangentially related to this...we are currently leaving the functionality of coreos-installer --console on the floor in other paths (Anaconda, bootc install).

Maaybe we should try to move this to bootupd, like bootupd sync-bootloader-kargs that uses the kernel cmdline as source of truth and syncs it to /boot/grub2/console.cfg or something.

I'm not really sure what the best path forward is here but maybe we can at least get the file right so I can update coreos-installer once and not twice?

Would 30_console.cfg work?

Copy link
Member

Choose a reason for hiding this comment

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

Would 30_console.cfg work?

Sure.

I'm not really sure what the best path forward is here but maybe we can at least get the file right so I can update coreos/coreos-installer#1360 (review) once and not twice?

If we go the bootupd path, the file wouldn't be written by coreos-installer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would 30_console.cfg work?

Sure.

ok cool - updated here. I split our configs out into 3 different ones now. I'll work on testing this.

I'm not really sure what the best path forward is here but maybe we can at least get the file right so I can update coreos/coreos-installer#1360 (review) once and not twice?

If we go the bootupd path, the file wouldn't be written by coreos-installer.

I think that would make bootupd a requirement of coreos-installer, which I think we'd have to think through the implications of.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, would probably need to vendor as a crate I guess.

dustymabe added a commit to dustymabe/coreos-installer that referenced this pull request Dec 15, 2023
Upstream we are starting to use grub configs that are partially
baked into bootupd [1] and partially baked into the image via
the OS vendor (in our case a grub2/50_coreos.cfg file [2]). Let's
look first to see if grub2/50_coreos.cfg exists when trying to
write new console settings before falling back to grub2/grub.cfg.

[1] coreos/bootupd#543
[2] coreos/fedora-coreos-config#2769
dustymabe added a commit to dustymabe/coreos-installer that referenced this pull request Dec 15, 2023
Upstream we are starting to use grub configs that are partially
baked into bootupd [1] and partially baked into the image via
the OS vendor (in our case a grub2/30_console.cfg file [2]). Let's
look first to see if grub2/30_console.cfg exists when trying to
write new console settings before falling back to grub2/grub.cfg.

[1] coreos/bootupd#543
[2] coreos/fedora-coreos-config#2769
bootupd upstream was modified to store default static grub configs
and allow for OS integrators to add their own snippets by placing
files in /usr/lib/bootupd/grub2-static/configs.d/ [1] When we move
to building with osbuild we will start taking advantage of this
functionality and calling bootupd with --with-static-configs. Let's
go ahead and add our snippets here so they can be leveraged when we
start calling bootupd with --with-static-configs.

The snippets added here come from the parts of the config currently
defined in coreos-assembler that weren't lifted into bootupd [2][3][4].

[1] coreos/bootupd#543
[2] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L58-L60
[3] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L71-L85
[4] https://github.com/coreos/coreos-assembler/blob/4636b1a5c6dc00b1d6a58b1bfbb199431444336b/src/grub.cfg#L87-L91
@dustymabe dustymabe force-pushed the dusty-bootupd-static-configs branch from abe42fe to d111bac Compare December 15, 2023 19:43
@dustymabe
Copy link
Member Author

local tests on this are looking good.

keep in mind these files currently won't be used in FCOS/RHCOS until we either change cause to call bootupd with --with-static-config or we switch to using osbuild and set with static configs to true.

This is mostly enablement, but doesn't make any concrete changes for now.

@dustymabe dustymabe enabled auto-merge (rebase) December 15, 2023 21:05
@dustymabe dustymabe merged commit b40f727 into coreos:testing-devel Dec 15, 2023
3 checks passed
@dustymabe dustymabe deleted the dusty-bootupd-static-configs branch December 15, 2023 21:18
dustymabe added a commit to dustymabe/os that referenced this pull request Jan 5, 2024
See coreos/fedora-coreos-config#2769

This won't really have any effect right now but will enable someone
to use the generated ociarchive container images in the OSBuild
workflow that calls bootupctl with the --with-static-configs argument.
dustymabe added a commit to dustymabe/os that referenced this pull request Jan 5, 2024
See coreos/fedora-coreos-config#2769

This won't really have any effect right now but will enable someone
to use the generated ociarchive container images in the OSBuild
workflow that calls bootupctl with the --with-static-configs argument.

(cherry picked from commit 2771ca2)
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.

2 participants