Skip to content

Misc SecureBoot changes#552

Merged
mika merged 3 commits into
masterfrom
mika/secureboot
Jul 17, 2026
Merged

Misc SecureBoot changes#552
mika merged 3 commits into
masterfrom
mika/secureboot

Conversation

@mika

@mika mika commented Jul 12, 2026

Copy link
Copy Markdown
Member
  • SecureBoot: read secureboot/grub.cfg also from main GRUB configuration
  • SecureBoot: fix prefix setting
  • SecureBoot: update debugging hints in grub.cfg

Disclaimer: I still don't know why the SecureBoot theme usage broke, secureboot/grub.cfg in the efi.img just isn't read any longer. :-/

mika added 3 commits July 13, 2026 00:23
The `search.file "${prefix}/grub.cfg"` won't be useful, as $prefix
usually contains something like (cd0) and then search.file fails.
Explicitly ask for /boot/grub/grub.cfg, which we hardcode in
config/media-scripts/GRMLBASE/10-efi anyways.

Additionally ask for listing of $prefix/grub.cfg, to have an idea
whether the file exists at all.
We can't set $prefix to ($root)/${prefix}/, as $prefix is usually
already populated with "something" and we therefore end end up with an
unexpected and failing $prefix.

Instead, use /boot/grub as set in config/scripts/GRMLBASE/45-grub-images
and config/media-scripts/GRMLBASE/10-efi.

Fixup for 5c048ce
For yet unknown reasons, the secureboot/grub.cfg configuration file is
no longer sourced on booting. The file can be sourced just fine though,
but due to our copy-media-files + mv actions, the file is no longer
available on the live system.

Instead, let's make it a copy and try to read the file from the main
GRUB configuration also (if $grml_secureboot is still unset, it means we
didn't read the file yet).
@mika
mika requested a review from zeha July 13, 2026 10:03
## grub2 configuration

# secure boot, read only if not already sourced elsewhere
if [ "${grml_secureboot}" = "" ] ; then

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.

not sure what we really need from secureboot/grub.cfg. if we only need grml_secureboot being set correctly, maybe its smarter to move the wrmsr test into grub.cfg and not source secureboot/grub.cfg?

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.

The secureboot/grub.cfg was meant as main entrance point as /boot/grub/grub.cfg in the efi.img (see config/media-scripts/GRMLBASE/10-efi), but yeah, maybe we can re-design this?

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.

Yeah I remember it was like that, but if it doesn't get loaded, lets put the relevant parts into the normal grub.cfg and keep the (debug) messages in secureboot/grub.cfg?

Sourcing secureboot/grub.cfg from the main config just seems to make things harder to understand?

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.

Absolutely, this only needs further work then. :) FTR, the changes I provide here and in grml-terminalserer as grml/grml-terminalserver#27 are what I was working on for Grml-Forensic, extensively tested and also released as such ("internally"). It's working as-is, the only thing that's not working yet is displaying "SecureBoot" on the splash screen when booting via PXE/netboot, but that's mainly a cosmetic issue only (and I need to see whether there actually is a good solution to get this working at all, given the limitations of test -f ... not working via tftp ;(

(Sorry for the ping-pong in "resolve converstation", GitHub doing strange things on a flaky network connection on a train ride)

@mika
mika merged commit 99f312c into master Jul 17, 2026
18 of 34 checks passed
@mika
mika deleted the mika/secureboot branch July 17, 2026 00:36
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