talos-rpi5/patches/siderolabs/talos/0002-Skip-NVRAM-writes-for-GRUB-on-arm64.patch
Mathias Beaulieu-Duncan 689b9402a8
All checks were successful
Build Talos CM5 Image / build (push) Successful in 1h4m48s
Add GRUB bootloader patches for talosctl upgrade on RPi5/CM5
Force GRUB instead of sd-boot on arm64 and pass --no-nvram to
  grub-install, working around the SetVariableRT firmware limitation
  that prevents in-place upgrades on RPi5/CM5 hardware.

  Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:20:18 -05:00

34 lines
1.4 KiB
Diff

From 2db8797af370535aba7c5694cd291bba8e6c5a67 Mon Sep 17 00:00:00 2001
From: Mathias Beaulieu-Duncan <mathias@svrnty.io>
Date: Fri, 13 Feb 2026 19:08:41 -0500
Subject: [PATCH 2/3] Skip NVRAM writes for GRUB on arm64
On arm64 platforms like RPi5/CM5, the UEFI firmware (U-Boot) does not
support EFI runtime SetVariable, causing grub-install to fail when
efibootmgr tries to create NVRAM boot entries. Since arm64-efi systems
boot by convention (finding BOOTAA64.efi on the ESP), NVRAM boot
entries are unnecessary.
Pass --no-nvram to grub-install on arm64 to allow in-place upgrades
via talosctl upgrade to succeed.
---
.../machined/pkg/runtime/v1alpha1/bootloader/grub/install.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/install.go b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/install.go
index 6f5c9f8..766374b 100644
--- a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/install.go
+++ b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/install.go
@@ -196,7 +196,7 @@ func (c *Config) install(opts options.InstallOptions) (*options.InstallResult, e
args = append(args, "--efi-directory="+filepath.Join(opts.MountPrefix, constants.EFIMountPoint))
}
- if opts.ImageMode {
+ if opts.ImageMode || opts.Arch == arm64 {
args = append(args, "--no-nvram")
}
--
2.50.1 (Apple Git-155)