2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-12 08:12:33 +00:00

refactor(go-xcat): define the riscv64 filter before a sourced run returns

A sourced go-xcat returns before the main program, which defined
riscv64_install_list, so a test that sources the script could not call
the filter. The function is now defined above the main program. A run of
the script does the same as before.
This commit is contained in:
Vinícius Ferrão
2026-10-02 20:06:08 -03:00
parent aa6a8a19e5
commit 5461b767ca
+23 -23
View File
@@ -2475,6 +2475,29 @@ function boo_boo_if_bad()
exit "${rc}"
}
# 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}"
}
#
# |\/| _.o._ ._ .__ _ .__.._ _ _ _ _ _ |_ _ .__
# | |(_||| | |_)|(_)(_||(_|| | | (_|(_)(/__> | |(/_|(/_ o
@@ -2597,29 +2620,6 @@ case "${GO_XCAT_ARCH}" in
;;
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