From 11da82dbbae4c8a7db65aaff704715ade7f15228 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 2 Sep 2026 12:41:46 -0300 Subject: [PATCH] fix(xcat-core): the genesis specs have no riscv64 branch, so %{tarch} stays literal A riscv64 build of xcat-core dies at xCAT-genesis-scripts with "Cannot find/open srpm: ...xCAT-genesis-scripts-riscv64-2.19.0-.src.rpm", because the srpm rpm produced is named xCAT-genesis-scripts-%{tarch}-2.19.0-.src.rpm. xCAT-genesis-scripts.spec and xCAT-genesis-base.spec take their package name from %{tarch}, which an %ifarch ladder sets for x86, x86_64, ppc64 and aarch64. riscv64 is absent, so rpm leaves the macro unexpanded and builds a package whose NAME contains it. buildrpms.pl then looks for the name it asked for and cannot find it. Add the riscv64 branch to both specs. An arch that is still missing from the ladder now stops the build with %{error:} instead of naming a package after a macro. xCAT-test/unit/genesis_spec_target_arch.t covers this: it fails on riscv64 without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit c9de89ccceaaa618f9e91568d74812b349c513ac) --- xCAT-genesis-builder/xCAT-genesis-base.spec | 8 ++++++++ xCAT-genesis-scripts/xCAT-genesis-scripts.spec | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index 1a6f0f212..f2b790e51 100644 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -12,6 +12,14 @@ Release: %{?release:%{release}}%{!?release:%(cat Release)} %ifarch aarch64 %define tarch aarch64 %endif +%ifarch riscv64 +%define tarch riscv64 +%endif +# An arch missing from the ladder above leaves %{tarch} unexpanded, and rpm then builds a package +# with a macro in its NAME instead of failing. Stop the build here instead. +%if ! %{defined tarch} +%{error:no genesis tarch for %{_target_cpu} -- add an %%ifarch branch above} +%endif BuildArch: noarch %define name xCAT-genesis-base-%{tarch} %define __spec_install_post : diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index f42ffd477..1760f86d7 100644 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -10,6 +10,14 @@ %ifarch aarch64 %define tarch aarch64 %endif +%ifarch riscv64 +%define tarch riscv64 +%endif +# An arch missing from the ladder above leaves %{tarch} unexpanded, and rpm then builds a package +# with a macro in its NAME instead of failing. Stop the build here instead. +%if ! %{defined tarch} +%{error:no genesis tarch for %{_target_cpu} -- add an %%ifarch branch above} +%endif %define rpminstallroot /opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs BuildArch: noarch %define name xCAT-genesis-scripts-%{tarch}