2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-21 16:39:30 +00:00

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-<release>.src.rpm", because the srpm
rpm produced is named xCAT-genesis-scripts-%{tarch}-2.19.0-<release>.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)
This commit is contained in:
Daniel Hilst
2026-09-02 12:41:46 -03:00
parent 3992a3c9c4
commit 11da82dbba
2 changed files with 16 additions and 0 deletions
@@ -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 :
@@ -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}