Commit 41cae0ed authored by Leif Lindholm's avatar Leif Lindholm Committed by Colin Watson

efi: Add GRUB_PE32_MAGIC definition

Add a generic GRUB_PE32_MAGIC definition for the PE 'MZ' tag and delete
the existing one in arm64/linux.h.

Update arm64 Linux loader to use this new definition.
Signed-off-by: 's avatarLeif Lindholm <leif.lindholm@linaro.org>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=c5841ba7f0d14c193f20854e7e55b4f7ce9207d5
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-add-GRUB_PE32_MAGIC-definition.patch
parent c45b3e3c
......@@ -52,7 +52,7 @@ grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh)
if (lh->magic != GRUB_ARM64_LINUX_MAGIC)
return grub_error(GRUB_ERR_BAD_OS, "invalid magic number");
if ((lh->code0 & 0xffff) != GRUB_EFI_PE_MAGIC)
if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled"));
......
......@@ -23,8 +23,6 @@
#define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */
#define GRUB_EFI_PE_MAGIC 0x5A4D
/* From linux/Documentation/arm64/booting.txt */
struct grub_arm64_linux_kernel_header
{
......
......@@ -45,6 +45,8 @@
#define GRUB_PE32_MSDOS_STUB_SIZE 0x80
#define GRUB_PE32_MAGIC 0x5a4d
/* According to the spec, the minimal alignment is 512 bytes...
But some examples (such as EFI drivers in the Intel
Sample Implementation) use 32 bytes (0x20) instead, and it seems
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment