63 lines
2.8 KiB
Diff
63 lines
2.8 KiB
Diff
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
|