diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index a076797b9..f1c452c7c 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2461,13 +2461,45 @@ case "${GO_XCAT_OS}" in esac case "${GO_XCAT_ARCH}" in -"ppc64"|"ppc64le"|"x86_64") +"ppc64"|"ppc64le"|"riscv64"|"x86_64") ;; *) exit_if_bad 1 "${GO_XCAT_ARCH}: unsupported instruction set architecture" ;; esac +# A riscv64 management node has no legacy Genesis: its image ships as the OpenEmbedded package, +# which mknb installs. The legacy Genesis scripts and bases are therefore dropped and the +# OpenEmbedded package of the architecture is asked for instead. +# +# The x86 boot loaders stay: they are payload a management node SERVES to x86 nodes over TFTP, +# not host binaries, so a riscv64 management node needs them to boot a mixed cluster. +function riscv64_install_list() +{ + local genesis_package="xCAT-genesis-openembedded-riscv64" + type dpkg >/dev/null 2>&1 && genesis_package="xcat-genesis-openembedded-riscv64" + local package + for package in "$@"; do + case "${package}" in + *genesis-scripts-*|*genesis-base-*) + ;; + *) + printf '%s\n' "${package}" + ;; + esac + done + printf '%s\n' "${genesis_package}" +} + +if [ "${GO_XCAT_ARCH}" = "riscv64" ]; then + riscv64_list=() + while read -r package; do + riscv64_list+=("${package}") + done < <(riscv64_install_list "${GO_XCAT_INSTALL_LIST[@]}") + GO_XCAT_INSTALL_LIST=("${riscv64_list[@]}") + unset riscv64_list package +fi + GO_XCAT_LINUX_DISTRO="$(check_linux_distro)" GO_XCAT_LINUX_VERSION="$(check_linux_version)"