Add RISC-V support

This commit is contained in:
Andrew Lukoshko 2026-05-19 19:06:28 +00:00 committed by root
parent 16b0382f1f
commit ccc8305f03
2 changed files with 69 additions and 1 deletions

View File

@ -0,0 +1,62 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrew Lukoshko <alukoshko@almalinux.org>
Date: Thu, 20 Feb 2026 00:00:00 +0000
Subject: [PATCH] Add riscv64 architecture support
Add RISC-V 64-bit (riscv64) to the set of supported architectures.
RISC-V uses UEFI boot like aarch64, so no special bootloader partition
is needed.
Changes:
- discoverable_partition_specification: add riscv64 to this_arch_root()
- install: add riscv64 to ARCH_USES_EFI
- install/baseline: add riscv64 to partitioning arch checks
Signed-off-by: Andrew Lukoshko <alukoshko@almalinux.org>
---
crates/lib/src/discoverable_partition_specification.rs | 2 ++
crates/lib/src/install.rs | 2 +-
crates/lib/src/install/baseline.rs | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/crates/lib/src/discoverable_partition_specification.rs b/crates/lib/src/discoverable_partition_specification.rs
index d5432e7..344b232 100644
--- a/crates/lib/src/discoverable_partition_specification.rs
+++ b/crates/lib/src/discoverable_partition_specification.rs
@@ -457,6 +457,8 @@ pub const fn this_arch_root() -> &'static str {
ROOT_PPC64
} else if #[cfg(all(target_arch = "powerpc64", target_endian = "little"))] {
ROOT_PPC64_LE
+ } else if #[cfg(target_arch = "riscv64")] {
+ ROOT_RISCV64
} else {
compile_error!("Unsupported architecture")
}
diff --git a/crates/lib/src/install.rs b/crates/lib/src/install.rs
index 105e2b3..052b208 100644
--- a/crates/lib/src/install.rs
+++ b/crates/lib/src/install.rs
@@ -87,7 +87,7 @@ const OSTREE_COMPOSEFS_SUPER: &str = ".ostree.cfs";
const SELINUXFS: &str = "/sys/fs/selinux";
/// The mount path for uefi
pub(crate) const EFIVARFS: &str = "/sys/firmware/efi/efivars";
-pub(crate) const ARCH_USES_EFI: bool = cfg!(any(target_arch = "x86_64", target_arch = "aarch64"));
+pub(crate) const ARCH_USES_EFI: bool = cfg!(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "riscv64"));
pub(crate) const EFI_LOADER_INFO: &str = "LoaderInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f";
diff --git a/crates/lib/src/install/baseline.rs b/crates/lib/src/install/baseline.rs
index d05604e..34d3187 100644
--- a/crates/lib/src/install/baseline.rs
+++ b/crates/lib/src/install/baseline.rs
@@ -272,7 +272,7 @@ pub(crate) fn install_create_rootfs(
&mut partitioning_buf,
r#"size=4MiB, bootable, type={uuid}, name="{label}""#
)?;
- } else if cfg!(any(target_arch = "aarch64", target_arch = "s390x")) {
+ } else if cfg!(any(target_arch = "aarch64", target_arch = "s390x", target_arch = "riscv64")) {
// No bootloader partition is necessary
} else {
anyhow::bail!("Unsupported architecture: {}", std::env::consts::ARCH);
--
2.43.0

View File

@ -5,7 +5,7 @@
release_number = 1;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}.alma.1
## END: Set by rpmautospec
%bcond_without check
@ -49,6 +49,9 @@ URL: https://github.com/bootc-dev/bootc
Source0: %{url}/releases/download/v%{version}/bootc-%{version}.tar.zstd
Source1: %{url}/releases/download/v%{version}/bootc-%{version}-vendor.tar.zstd
# AlmaLinux Patch
Patch1001: 0001-Add-riscv64-architecture-support.patch
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}
@ -223,6 +226,9 @@ fi
%endif
%changelog
* Tue May 19 2026 Andrew Lukoshko <alukoshko@almalinux.org> - 1.15.1-1.alma.1
- Add RISC-V support
## START: Generated by rpmautospec
* Tue Apr 14 2026 Joseph Marrero Corchado <jmarrero@redhat.com> - 1.15.1-1
- Release 1.15.1