From 38be1b3221b1e85cac1af8a67c733752265425d7 Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Wed, 25 Aug 2021 12:02:32 +0200 Subject: Add sys-boot/grub-2.06-r1 --- ...b-2.06-005-loader-move-arm64-linux-loader.patch | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sys-boot/grub/files/grub-2.06-005-loader-move-arm64-linux-loader.patch (limited to 'sys-boot/grub/files/grub-2.06-005-loader-move-arm64-linux-loader.patch') diff --git a/sys-boot/grub/files/grub-2.06-005-loader-move-arm64-linux-loader.patch b/sys-boot/grub/files/grub-2.06-005-loader-move-arm64-linux-loader.patch new file mode 100644 index 0000000..4a98b44 --- /dev/null +++ b/sys-boot/grub/files/grub-2.06-005-loader-move-arm64-linux-loader.patch @@ -0,0 +1,73 @@ +ARM64 linux loader code is written in such a way that it can be reused +across different architectures without much change. Move it to common +code so that RISC-V doesn't have to define a separate loader. + +Signed-off-by: Atish Patra +--- + grub-core/Makefile.core.def | 4 ++-- + grub-core/loader/{arm64 => efi}/linux.c | 2 +- + include/grub/arm/linux.h | 2 +- + include/grub/arm64/linux.h | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + rename grub-core/loader/{arm64 => efi}/linux.c (99%) + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 8022e1c0a..b36cf663a 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1806,9 +1806,9 @@ module = { + sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c; + ia64_efi = loader/ia64/efi/linux.c; + arm_coreboot = loader/arm/linux.c; +- arm_efi = loader/arm64/linux.c; ++ arm_efi = loader/efi/linux.c; + arm_uboot = loader/arm/linux.c; +- arm64 = loader/arm64/linux.c; ++ arm64 = loader/efi/linux.c; + riscv32 = loader/riscv/linux.c; + riscv64 = loader/riscv/linux.c; + common = loader/linux.c; +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/efi/linux.c +similarity index 99% +rename from grub-core/loader/arm64/linux.c +rename to grub-core/loader/efi/linux.c +index 65f1275fb..60f0fa264 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/efi/linux.c +@@ -60,7 +60,7 @@ grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh) + struct grub_pe32_coff_header *coff_header; + struct grub_pe32_optional_header *optional_header; + +- if (lh->magic != GRUB_LINUX_ARMXX_MAGIC_SIGNATURE) ++ if (lh->magic != GRUB_LINUX_ARCH_MAGIC_SIGNATURE) + return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); + + if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC) +diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h +index bcd5a7eb1..8c13978d2 100644 +--- a/include/grub/arm/linux.h ++++ b/include/grub/arm/linux.h +@@ -35,7 +35,7 @@ struct linux_arm_kernel_header { + }; + + #if defined(__arm__) +-# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE ++# define GRUB_LINUX_ARCH_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE + # define linux_arch_kernel_header linux_arm_kernel_header + #endif + +diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h +index 7e22b4ab6..effd870ef 100644 +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -39,7 +39,7 @@ struct linux_arm64_kernel_header + }; + + #if defined(__aarch64__) +-# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE ++# define GRUB_LINUX_ARCH_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE + # define linux_arch_kernel_header linux_arm64_kernel_header + #endif + +-- +2.29.3 -- cgit v1.2.3