From 1d496f56cec65e05bff5bbf92ce4d0c18f9e0bb8 Mon Sep 17 00:00:00 2001 From: Nicolas Frayer Date: Thu, 27 Mar 2025 17:36:03 +0100 Subject: [PATCH] Add riscv64 support Resolves: #RHEL-83387 Signed-off-by: Nicolas Frayer --- ...t-have-arm-as-an-alt-arch-of-aarch64.patch | 26 ---------- 0001-add-riscv64-support.patch | 50 +++++++++++++++++++ ...efile-fix-permission-on-boot-efi-EFI.patch | 29 ----------- efi-rpm-macros.spec | 7 ++- 4 files changed, 56 insertions(+), 56 deletions(-) delete mode 100644 0001-Don-t-have-arm-as-an-alt-arch-of-aarch64.patch create mode 100644 0001-add-riscv64-support.patch delete mode 100644 0002-Makefile-fix-permission-on-boot-efi-EFI.patch diff --git a/0001-Don-t-have-arm-as-an-alt-arch-of-aarch64.patch b/0001-Don-t-have-arm-as-an-alt-arch-of-aarch64.patch deleted file mode 100644 index 44f91d7..0000000 --- a/0001-Don-t-have-arm-as-an-alt-arch-of-aarch64.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Tue, 31 Aug 2021 16:33:07 -0400 -Subject: [PATCH] Don't have arm as an alt arch of aarch64 - -The compiler isn't actually set up in a way that lets us do this without -a cross compiler, so we shouldn't do this this way. - -Signed-off-by: Peter Jones ---- - macros.efi-srpm.in | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/macros.efi-srpm.in b/macros.efi-srpm.in -index 4d7b019..00503f1 100644 ---- a/macros.efi-srpm.in -+++ b/macros.efi-srpm.in -@@ -45,8 +45,6 @@ - local function getaltarch() - if arch("x86_64") then - return("ia32") -- elseif arch("aarch64") then -- return("arm") - else - return("none") - end diff --git a/0001-add-riscv64-support.patch b/0001-add-riscv64-support.patch new file mode 100644 index 0000000..d81320d --- /dev/null +++ b/0001-add-riscv64-support.patch @@ -0,0 +1,50 @@ +From 5f43c283de0a5749afd1e48f2a6b6e239b00a270 Mon Sep 17 00:00:00 2001 +From: Ahei +Date: Fri, 19 Jul 2024 17:06:28 +0800 +Subject: [PATCH] add riscv64 support + +--- + Makefile | 2 +- + efi-rpm-macros.spec.in | 2 +- + macros.efi-srpm.in | 2 ++ + 3 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 37e97a5..166ee97 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,7 +14,7 @@ override EFI_ESP_ROOT=/boot/efi + endif + EFI_ARCHES ?= $(call get-config,arches) + ifeq ($(EFI_ARCHES),) +-override EFI_ARCHES="x86_64 aarch64 %{arm} %{ix86}" ++override EFI_ARCHES="x86_64 aarch64 %{arm} %{ix86} riscv64" + endif + EFI_VENDOR ?= $(call get-config,vendor) + +diff --git a/efi-rpm-macros.spec.in b/efi-rpm-macros.spec.in +index e03262e..64a7109 100644 +--- a/efi-rpm-macros.spec.in ++++ b/efi-rpm-macros.spec.in +@@ -36,7 +36,7 @@ machine bootloaders and tools. + %autosetup -S git_am -n %{name}-@@EFI_SOURCE_VERSION@@ + git config --local --add efi.vendor "%{_efi_vendor_}" + git config --local --add efi.esp-root /boot/efi +-git config --local --add efi.arches "x86_64 aarch64 %{arm} %{ix86}" ++git config --local --add efi.arches "x86_64 aarch64 %{arm} %{ix86} riscv64" + + %build + %make_build clean all +diff --git a/macros.efi-srpm.in b/macros.efi-srpm.in +index 00503f1..7f258c7 100644 +--- a/macros.efi-srpm.in ++++ b/macros.efi-srpm.in +@@ -37,6 +37,8 @@ + return("aa64") + elseif arch("%{arm}") then + return("arm") ++ elseif arch("riscv64") then ++ return("riscv64") + else + return("none") + end diff --git a/0002-Makefile-fix-permission-on-boot-efi-EFI.patch b/0002-Makefile-fix-permission-on-boot-efi-EFI.patch deleted file mode 100644 index a8635f9..0000000 --- a/0002-Makefile-fix-permission-on-boot-efi-EFI.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 110b9c24200ff90c5d09cc2bf41df728810a0e0e Mon Sep 17 00:00:00 2001 -From: Sandro Bonazzola -Date: Wed, 3 May 2023 11:20:36 +0200 -Subject: [PATCH] Makefile: fix permission on /boot/efi/EFI - -Ensure /boot/efi/EFI is created with 0700 mode. - -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2144459 - -Signed-off-by: Sandro Bonazzola ---- - Makefile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Makefile b/Makefile -index 7d56eae..37e97a5 100644 ---- a/Makefile -+++ b/Makefile -@@ -65,6 +65,7 @@ install : $(TARGETS) - install -d -m 0755 $(DESTDIR)/boot ; \ - fi - install -d -m 0700 $(DESTDIR)/$(EFI_ESP_ROOT) -+ install -d -m 0700 $(DESTDIR)/$(EFI_ESP_ROOT)/EFI - install -d -m 0700 $(DESTDIR)/$(EFI_ESP_ROOT)/EFI/BOOT - install -d -m 0700 $(DESTDIR)/$(EFI_ESP_ROOT)/EFI/$(EFI_VENDOR) - --- -2.40.1 - diff --git a/efi-rpm-macros.spec b/efi-rpm-macros.spec index 309f83d..f81e0a8 100644 --- a/efi-rpm-macros.spec +++ b/efi-rpm-macros.spec @@ -1,7 +1,7 @@ Summary: Common RPM Macros for building EFI-related packages Name: efi-rpm-macros Version: 6 -Release: 6%{?dist} +Release: 7%{?dist} License: GPL-3.0-or-later URL: https://github.com/rhboot/%{name}/ BuildRequires: git sed @@ -9,6 +9,7 @@ BuildRequires: make BuildArch: noarch Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-6.tar.bz2 +Patch0001: 0001-add-riscv64-support.patch %global debug_package %{nil} %global _efi_vendor_ %(eval echo $(sed -n -e 's/rhel/redhat/' -e 's/^ID=//p' /etc/os-release)) @@ -66,6 +67,10 @@ git config --local --add efi.arches "x86_64 aarch64 %{arm} %{ix86}" %dir /boot/efi/EFI/%{_efi_vendor_} %changelog +* Thu Mar 27 2025 Nicolas Frayer - 6-7 +- Add riscv64 support +- Resolves: #RHEL-83387 + * Thu Dec 12 2024 Nicolas Frayer - 6-6 - Bump release for previous commit - Related: #RHELMISC-8249