all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: Efraim Flashner <efraim@flashner.co.il>, guix-devel@gnu.org
Subject: Re: universal aarch64/riscv64 images
Date: Mon, 27 Feb 2023 15:46:24 -0800	[thread overview]
Message-ID: <87cz5u1xkf.fsf@yucca> (raw)
In-Reply-To: <Y/0OAngSsiyWMRrf@3900XT>

[-- Attachment #1: Type: text/plain, Size: 2334 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

      reply	other threads:[~2023-02-27 23:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 20:09 universal aarch64/riscv64 images Efraim Flashner
2023-02-27 23:46 ` Vagrant Cascadian [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cz5u1xkf.fsf@yucca \
    --to=vagrant@debian.org \
    --cc=efraim@flashner.co.il \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.