Compare commits

...

9 Commits

Author SHA1 Message Date
c631589695 Merge remote-tracking branch 'abologna-fedpkg/f41-riscv64' into f41-riscv64 2024-11-20 11:13:44 -05:00
f0141b5891 Merge remote-tracking branch 'abologna/f41-riscv64' into f41-riscv64 2024-11-20 11:10:55 -05:00
Andrea Bolognani
7b0564ba57 Fix RISC-V build and re-enable all previously disabled patches
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-11-19 23:42:57 +01:00
bc3308e87c Add RISC-V patches and disable ARM patches breaking builds
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2024-11-08 18:49:36 +01:00
Andrea Bolognani
bdb72404c3 Merge remote-tracking branch 'fedora/f41' into f41-riscv64 2024-11-08 18:47:45 +01:00
d1ab37254e
Merge remote-tracking branch 'up/main' into main-riscv64
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2024-08-13 09:01:20 -04:00
38415bc393 disable patches breaking riscv64 add mcmodel patch for riscv64
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2024-08-01 21:38:43 -04:00
52d0a29121 Update to grub2.12
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2024-08-01 21:37:36 -04:00
2c4b7cb7ee
Merge remote-tracking branch 'up/main' into main-riscv64
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2024-08-01 19:44:15 -04:00
3 changed files with 78 additions and 9 deletions

View File

@ -0,0 +1,72 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 19 Nov 2024 15:42:01 +0000
Subject: [PATCH] loader/efi: Fix RISC-V build
Some struct definitions are currently limited to 32-bit and
64-bit Arm architectures, but they actually apply to other
architectures as well, specifically 32-bit and 64-bit RISC-V
respectively.
Update the preprocessor checks guarding their definition, and
change their names to make them more accurate by replacing the
word "arm" with the word "efi".
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
grub-core/loader/efi/linux.c | 2 +-
include/grub/efi/efi.h | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index 5889e3f36f8..ef55556f2d9 100644
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -684,7 +684,7 @@ parse_pe_header (void *kernel, grub_uint64_t *total_size,
grub_uint32_t *alignment, grub_uint32_t *code_size)
{
struct linux_arch_kernel_header *lh = kernel;
- struct grub_armxx_linux_pe_header *pe;
+ struct grub_efixx_linux_pe_header *pe;
grub_uint16_t i;
struct grub_pe32_section_table *sections;
diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
index 7eed1bd791d..81daf6bead1 100644
--- a/include/grub/efi/efi.h
+++ b/include/grub/efi/efi.h
@@ -36,28 +36,28 @@ struct linux_arch_kernel_header {
struct grub_pe_image_header pe_image_header;
};
-struct grub_arm_linux_pe_header
+struct grub_efi32_linux_pe_header
{
grub_uint32_t magic;
struct grub_pe32_coff_header coff;
struct grub_pe32_optional_header opt;
};
-struct grub_arm64_linux_pe_header
+struct grub_efi64_linux_pe_header
{
grub_uint32_t magic;
struct grub_pe32_coff_header coff;
struct grub_pe64_optional_header opt;
};
-#if defined(__arm__)
+#if defined(__arm__) || (defined(__riscv) && (__riscv_xlen == 32))
# define GRUB_PE32_PEXX_MAGIC GRUB_PE32_PE32_MAGIC
-# define grub_armxx_linux_pe_header grub_arm_linux_pe_header
+# define grub_efixx_linux_pe_header grub_efi32_linux_pe_header
#endif
-#if defined(__aarch64__)
+#if defined(__aarch64__) || (defined(__riscv) && (__riscv_xlen == 64))
# define GRUB_PE32_PEXX_MAGIC GRUB_PE32_PE64_MAGIC
-# define grub_armxx_linux_pe_header grub_arm64_linux_pe_header
+# define grub_efixx_linux_pe_header grub_efi64_linux_pe_header
#endif
#define GRUB_EFI_GRUB_VARIABLE_GUID \

View File

@ -250,26 +250,20 @@ Patch0249: 0249-grub-set-bootflag-Conservative-partial-fix-for-CVE-2.patch
Patch0250: 0250-grub-set-bootflag-More-complete-fix-for-CVE-2024-104.patch
Patch0251: 0251-grub-set-bootflag-Exit-calmly-when-not-running-as-ro.patch
Patch0252: 0252-Makefile.core.def-fix-linux-module.patch
%ifnarch riscv64
Patch0253: 0253-Add-support-for-Linux-EFI-stub-loading-on-arm-archit.patch
Patch0254: 0254-arm-arm64-loader-Better-memory-allocation-and-error-.patch
Patch0255: 0255-arm64-Fix-EFI-loader-kernel-image-allocation.patch
%endif
Patch0256: 0256-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch
%ifnarch riscv64
Patch0257: 0257-Correct-BSS-zeroing-on-aarch64.patch
Patch0258: 0258-arm64-Use-proper-memory-type-for-kernel-allocation.patch
%endif
Patch0259: 0259-normal-Remove-grub_env_set-prefix-in-grub_try_normal.patch
Patch0260: 0260-fs-xfs-Handle-non-continuous-data-blocks-in-director.patch
Patch0261: 0261-Ignore-warnings-for-incompatible-types.patch
Patch0262: 0262-cmd-search-Rework-of-CVE-2023-4001-fix.patch
%ifnarch riscv64
Patch0263: 0263-loader-efi-linux.c-read-the-kernel-image-before-head.patch
Patch0264: 0264-nx-set-attrs-in-our-kernel-loaders.patch
Patch0265: 0265-efi-Provide-wrappers-for-load_image-start_image.patch
Patch0266: 0266-efi-Disallow-fallback-to-legacy-Linux-loader-when-sh.patch
%endif
Patch0267: 0267-Set-non-executable-stack-sections-on-EFI-assembly-fi.patch
Patch0268: 0268-grub-mkconfig.in-turn-off-executable-owner-bit.patch
Patch0269: 0269-kern-ieee1275-init-Add-IEEE-1275-Radix-support-for-K.patch
@ -279,11 +273,10 @@ Patch0272: 0272-grub-mkconfig-Remove-check-for-mount-point-for-grub-.patch
Patch0273: 0273-efi-api.h-include-missing-__grub_efi_api-macros-on-E.patch
Patch0274: 0274-grub-core-net-arp.c-fix-variable-name.patch
Patch0275: 0275-load-EFI-commands-inside-test-expressions.patch
%ifnarch riscv64
Patch0276: 0276-efi-loader-Check-if-NX-is-required-in-grub_efi_linux.patch
%endif
Patch0277: 0277-Stop-grub.efi-from-always-printing-dynamic_load_symb.patch
Patch0278: 0278-acpi-Fix-out-of-bounds-access-in-grub_acpi_xsdt_find.patch
Patch0279: 0279-cmd-search-Fix-a-possible-NULL-ptr-dereference.patch
Patch0280: 0280-kern-riscv-efi-init-Use-time-register-in-grub_efi_ge.patch
Patch0281: 0281-Use-medany-instead-of-large-model-for-RISCV.patch
Patch0282: 0282-loader-efi-Fix-RISC-V-build.patch

View File

@ -17,7 +17,7 @@
Name: grub2
Epoch: 1
Version: 2.12
Release: 11.0.riscv64%{?dist}
Release: 11.1.riscv64%{?dist}
Summary: Bootloader with support for Linux, Multiboot and more
License: GPL-3.0-or-later
URL: http://www.gnu.org/software/grub/
@ -560,6 +560,10 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg
%endif
%changelog
* Tue Nov 19 2024 Andrea Bolognani <abologna@redhat.com> - 2.12-11.1.riscv64
- Fix RISC-V build
- Re-enable all previously disabled patches
* Fri Nov 08 2024 Jason Montleon <jmontleo@redhat.com> - 2.12-11.0.riscv64
- Add RISC-V specific patches
- Disable ARM patches on RISC-V that break builds