#1102607 Add support for U-Boot + grub-arm64-efi boot flow

#1102607#5
Date:
2025-04-10 21:58:47 UTC
From:
To:
It's currently possible to convert a Debian RPi4 installation to use
U-Boot and grub-arm64-efi for booting, with some effort. This comes
with several advantages:

* The kernel command line can be modified by /etc/default/grub and
  files under /etc/default/grub.d. Some software requires or benefits
  from modifications made to the kernel command line, and uses this
  mechanism in GRUB to make non-invasive changes to the command line.
  With direct kernel boot, these changes will be silently ignored,
  while with U-Boot + GRUB, these changes will be correctly used.
* In the event of a bad kernel update, users can trivially boot into
  older kernels like they would on a normal desktop system.
* Recovering from broken boot without a secondary system becomes much
  easier, since users can use the GRUB console and U-Boot console to
  debug issues and boot the system manually.
* Multiboot installations on the Pi become possible.

Doing this isn't too complicated, I documented the process at
https://www.kicksecure.com/wiki/Dev/boot#Booting_Debian_Trixie_with_GRUB_+_u-boot_on_Raspberry_Pi_4

Actually doing this is currently a hassle though for two main reasons:

* The u-boot-rpi image in /boot/firmware isn't updated when the
  u-boot-rpi package gets an update. It has to be manually copied by the
  end user to be updated.
* The config.txt (and possbily also cmdline.txt) files need
  modifications that simply can't be expressed by raspi-firmware's
  configuration files to provide an optimal (or even functional)
  experience. raspi-firmware will overwrite these files during updates.
  It will also copy unnecessary kernel and initramfs files to the
  firmware partition.

I would like to suggest (and if acceptable, contribute) the following
two features:

* A configuration option somewhere in raspi-firmware that disables
  automatic generation and updating of config.txt and cmdline.txt and
  copying of kernels and initramfs files.
* An option for U-Boot that will check if the bootloader image in the
  firmware partition is up-to-date and copy it if it is out of date.

Both of these things would be optional, so that both direct kernel boot
and booting via U-Boot + GRUB would be possible.

#1102607#10
Date:
2026-01-06 04:52:51 UTC
From:
To:
On second thought, I think it might be a better approach to add
additional config options to /etc/default/raspi-firmware, so that the
config.txt file it generates works with u-boot. Adding a configuration
directory at /etc/default/raspi-firmware.d would also be nice so that
upstream distributions can set these settings without conflicting with
Debian.

This might not be necessary. flash-kernel already has code that does
this, and there are PRs that will add support for Raspberry Pi 4B (and
other) machines which will make things work here. [1]

[1] https://salsa.debian.org/installer-team/flash-kernel/-/merge_requests/71