[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: universal aarch64/riscv64 images
From: |
Vagrant Cascadian |
Subject: |
Re: universal aarch64/riscv64 images |
Date: |
Mon, 27 Feb 2023 15:46:24 -0800 |
On 2023-02-27, Efraim Flashner wrote:
> I've been thinking some about how we create our disk images for aarch64
> devices and how we'll eventually create images for riscv64 devices.
> Currently we use u-boot to load extlinux to boot linux. I propose we use
> u-boot with its EFI interface to load grub-efi to boot linux.
>
> Major benefit of this is that we can create one generic aarch64 image
> using raw-with-offset to create the image and then ship a separate
> script to flash either the SD card or an SPI chip or whatever someone
> wants.
It is certainly worth exploring this!
That said...
By default u-boot will pass a device-tree from the one included u-boot,
which may or may not be compatible with the kernel you want to
boot. There is a mechanism for grub to load a specific device-tree,
but... that will be device-specific again, kind of weakening the
benefits of a device-agnostic "universal" image. Or fix grub to support
a device-tree-directory (much like u-boot syslinux/extlinux support).
U-boot does not (yet?) implement EFI variables, such as the boot order
for EFI to load, so you have to use the fallback /EFI/BOOT/BOOTX64.efi
path, rather than, say, /EFI/GUIX/GRUBX64.efi.
There are probably more surprises!
Ideally, you could build an image that supports both grub-efi and one of
u-boot's other boot methods (boot.scr, syslinux/extlinux style menu,
etc.) ... fundamentally speaking, I do not see any compelling reason you
could not have both grub-efi/grub.cfg and extlinux.conf on the same boot
media, and I have manually built images that do exactly that.
Then people can "bring their own boot firmware" either by using a system
with EFI already out of the box, or installing u-boot (possibly shipped
with guix) to other media, or directly onto the image itself. Or using
https://tow-boot.org, a u-boot fork for some platforms configured to be
installed outside of the boot media when possible (e.g. SPI or eMMC boot
partitions).
For maximal compatibility, I would suggest the first partition should
start at 16MB with an MBR/DOS-style partition table(GPT is basically
incompatible with sunxi64), leaving the rest of the image empty up till
the first partition, so that you can install u-boot directly to the
image if needed or desired. Welcome to the festival of rabbit holes!
live well,
vagrant
signature.asc
Description: PGP signature