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

Enable FIPS and SELinux for sdboot #125

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

danyspin97
Copy link
Contributor

When running on a sdboot, modify /etc/kernel/cmdline instead of the grub config.

Fixes #113

@danyspin97
Copy link
Contributor Author

This doesn't fix Grub with BLS yet, I am currently looking into that.

@aplanas
Copy link
Collaborator

aplanas commented Jul 10, 2024

This doesn't fix Grub with BLS yet, I am currently looking into that.

Needs to be tested, but grub2-bls should also work with this change in /etc/kernel/cmdline, as the entry is created by sdbootutil the same for any boot loader (minus some checks related with the entry name)

@laenion
Copy link
Collaborator

laenion commented Jul 11, 2024

So would it work if - instead of checking for an sdboot system explicitly - both /etc/default/grub and /etc/kernel/cmdline would just be changed if they are present? Or mustn't /etc/default/grub be changed any more when using GRUB2 with BLS?

@aplanas
Copy link
Collaborator

aplanas commented Jul 11, 2024

grub2-bls and systemd-boot under sdbootutil only requires changes in /etc/kernel/cmdline. sdbootutil is agnostic of the boot loaders as far as it is BLS

So, no, from grub2-bls no change in /etc/default/grub will make sense

@laenion
Copy link
Collaborator

laenion commented Jul 11, 2024

That would mean the differentiator shouldn't be /boot/efi/EFI/systemd/installed_by_sdbootutil as in the current patch, but it should check for and modify /etc/kernel/cmdline instead, and /etc/default/grub otherwise, correct?

@aplanas
Copy link
Collaborator

aplanas commented Jul 11, 2024

Better differentiator is /etc/kernel/cmdline, right? In BLS some agent will create the boot entries. For us is sdbootutil, but this can be a transient status.

This agent will use /etc/kernel/cmdline also, as sdbootutil is doing. So IMHO if [ -f /etc/kernel/cmdline ]; then update this file, else update /etc/default/grub

@aplanas
Copy link
Collaborator

aplanas commented Jul 11, 2024

I just remembered, perl-Bootloader can also touch and reference the /etc/kernel/cmdline and the boot entries.

When running on a sdboot, modify /etc/kernel/cmdline instead of the grub
config.

Fixes openSUSE#113
@danyspin97
Copy link
Contributor Author

I have updated the PR to use /etc/kernel/cmdline, so that grub2-bls is also supported. Thanks for the pointers!

@laenion
Copy link
Collaborator

laenion commented Jul 31, 2024

Perfect - thanks a lot!

@laenion laenion merged commit dab529f into openSUSE:master Jul 31, 2024
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.

use /etc/kernel/cmdline when using sdboot
3 participants