grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386


From: Ard Biesheuvel
Subject: Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
Date: Tue, 23 May 2023 17:34:38 +0200

On Tue, 23 May 2023 at 17:32, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> Switch the x86 based EFI platform builds to the generic EFI loader,
> which exposes the initrd via the LoadFile2 protocol instead of the
> x86-specific setup header. This will launch the Linux kernel via its EFI
> stub, which performs its own initialization in the EFI boot services
> context before calling ExitBootServices() and performing the bare metal
> Linux boot.
>
> Given that only Linux kernel versions v5.8 and later support this initrd
> loading method, the existing x86 loader is retained as a fallback, which
> will also be used for Linux kernels built without the EFI stub. In this
> case, GRUB calls ExitBootServices() before entering the Linux kernel,
> and all EFI related information is provided to the kernel via struct
> boot_params in the setup header, as before.
>
> Note that this means that booting EFI stub kernels older than v5.8 is
> not supported even when not using an initrd at all. Also, the EFI
> handover protocol, which has no basis in the UEFI specification, is not
> implemented.
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

This patch needs the hunk below, which i failed to git add - apologies

--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -360,7 +360,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__
((unused)),
                 int argc, char *argv[])
 {
   int __attribute__ ((unused)) initrd_size, initrd_pages;
-  void *initrd_mem = NULL;
+  void *__attribute__ ((unused)) initrd_mem = NULL;
   grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;
   grub_efi_status_t status;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]