bootc/files/0001-Add-riscv64-architecture-support.patch
eabdullin 8e49bcdabe Drop discoverable_partition_specification hunk merged upstream in 1.15.2
The first hunk of the riscv64 patch adds an else-if branch to
this_arch_root() in
crates/lib/src/discoverable_partition_specification.rs. Upstream bootc
accepted the same change in commit 47c3620 ("fix: add riscv64 to
this_arch_root"), shipped in v1.15.2. As a result the hunk now matches
already-applied code and `patch -f --fuzz=0` fails the whole %prep,
breaking build #56177 on every arch.

Drop that hunk; keep the two install.rs / install/baseline.rs hunks,
which upstream still does not have.
2026-05-12 12:04:00 +03:00

54 lines
2.3 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:
- install: add riscv64 to ARCH_USES_EFI
- install/baseline: add riscv64 to partitioning arch checks
Note: the riscv64 branch in this_arch_root() (in
crates/lib/src/discoverable_partition_specification.rs) was accepted
upstream in bootc commit 47c3620 ("fix: add riscv64 to this_arch_root")
and is already present in v1.15.2, so it is no longer carried here.
Signed-off-by: Andrew Lukoshko <alukoshko@almalinux.org>
---
crates/lib/src/install.rs | 2 +-
crates/lib/src/install/baseline.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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