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}