Adjust 0004 patch to incl. riscv

Note that this might need further modifications once there is Linux
support in grub-core/loader/riscv/linux.c

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2019-11-09 20:08:27 +02:00
parent 9ba2389d13
commit cb5f87387b
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,32 @@
From d03ba7d8e84f6e87badcde529434686ed32ee10f Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
Date: Sat, 9 Nov 2019 18:06:32 +0000
Subject: [PATCH] Adjust 0004 patch to incl. riscv
Note, that grub-core/loader/riscv/linux.c is skipped because
Linux is not supported yet. This patch might need a new revision
once Linux is actually supported.
This extends 0004-Add-secureboot-support-on-efi-chainloader.patch
---
grub-core/loader/efi/chainloader.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
index f4ddbed..2c529f7 100644
--- a/grub-core/loader/efi/chainloader.c
+++ b/grub-core/loader/efi/chainloader.c
@@ -316,6 +316,10 @@ static const grub_uint16_t machine_type __attribute__((__unused__)) =
GRUB_PE32_MACHINE_I386;
#elif defined(__ia64__)
GRUB_PE32_MACHINE_IA64;
+#elif defined(__riscv) && (__riscv_xlen == 32)
+ GRUB_PE32_MACHINE_RISCV32;
+#elif defined(__riscv) && (__riscv_xlen == 64)
+ GRUB_PE32_MACHINE_RISCV64;
#else
#error this architecture is not supported by grub2
#endif
--
2.24.0

View File

@ -184,3 +184,4 @@ Patch0183: 0183-Don-t-add-a-class-option-to-menu-entries-generated-f.patch
Patch0184: 0184-10_linux.in-Also-use-GRUB_CMDLINE_LINUX_DEFAULT-to-s.patch
Patch0185: 0185-blscfg-Don-t-hardcode-an-env-var-as-fallback-for-the.patch
Patch0200: 0001-Add-riscv64-to-150-patch.patch
Patch0201: 0001-Adjust-0004-patch-to-incl.-riscv.patch