Skip to content

Enable UEFI Secure Boot - #697

Open
s4heid wants to merge 1 commit into
cloudfoundry:ubuntu-noblefrom
s4heid:azure-secure-boot
Open

Enable UEFI Secure Boot#697
s4heid wants to merge 1 commit into
cloudfoundry:ubuntu-noblefrom
s4heid:azure-secure-boot

Conversation

@s4heid

@s4heid s4heid commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Stemcells currently ship an unsigned GRUB, so they cannot boot on a VM where UEFI Secure Boot is enforced (e.g. Azure Secure Boot / Trusted Launch). This installs the signed boot chain and puts GRUB's config where the signed binary looks for it.

The extra grub.cfg is needed, because the signed GRUB binaries have their prefix baked in at build time, and changing it invalidates the signature. With --removable, grub-install installs gcdx64.efi.signed under EFI/BOOT/grubx64.efi and that image's prefix is /boot/grub, resolved against the partition it was loaded from, i.e. the ESP. It therefore never reads the redirect grub-install writes to EFI/BOOT/grub.cfg. With no config at the path it does read, GRUB drops into the rescue shell. Copying grub-install's generated redirect to that path fixes it.

Reviewer Note

This change affects all IaaS and secure boot then works wherever a platform enforces it. Azure Gen2 Trusted Launch is one such case, and is where this was validated. However, it would be good, if someone with access to another IaaS could validate this doesn't break anything.

Validation

Booted a stemcell built from this branch on an Azure Gen2 Trusted Launch VM with Secure Boot enabled and Standard VM.

Secure Boot requires a Microsoft-signed shim that chainloads a Canonical-signed
GRUB. Installing grub-efi-amd64-signed and shim-signed makes grub-install lay
down that chain instead of the unsigned image it builds itself.

Signed GRUB binaries carry their prefix baked in, and it cannot be changed
without invalidating the signature. With --removable, grub-install installs
gcdx64.efi.signed as EFI/BOOT/grubx64.efi, whose prefix is /boot/grub relative
to the partition it was loaded from - the ESP. That image never reads the
redirect grub-install writes to EFI/BOOT/grub.cfg, so without a config at the
path it does read, GRUB drops into the rescue shell. Copy grub-install's own
redirect there instead of hardcoding the ESP UUID a second time.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f1f57a8a-e7f5-4a3a-949a-7276e3588cf0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jul 30, 2026
@beyhan
beyhan requested review from a team, ragaskar and ystros and removed request for a team July 30, 2026 14:45
@beyhan beyhan moved this from Pending Merge | Prioritized to Pending Review | Discussion in Foundational Infrastructure Working Group Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Review | Discussion

Development

Successfully merging this pull request may close these issues.

2 participants