mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-09 05:00:44 +00:00
38 lines
941 B
Python
Executable File
38 lines
941 B
Python
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
oe_dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
|
|
: "${XCAT_GENESIS_WORK_DIR:=$oe_dir/.work}"
|
|
: "${KAS:=kas}"
|
|
|
|
supported_architectures='aarch64 armv7hf riscv64 s390x x86 x86_64 ppc64 ppc64le'
|
|
if [ "$#" -eq 1 ] && [ "$1" = '--list-architectures' ]; then
|
|
printf '%s\n' $supported_architectures
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p "$XCAT_GENESIS_WORK_DIR"
|
|
|
|
export KAS_WORK_DIR="$XCAT_GENESIS_WORK_DIR"
|
|
export KAS_BUILD_DIR="$XCAT_GENESIS_WORK_DIR/build"
|
|
|
|
if [ "$#" -eq 0 ]; then
|
|
set -- x86_64
|
|
fi
|
|
|
|
for architecture do
|
|
architecture_supported=0
|
|
for candidate in $supported_architectures; do
|
|
if [ "$architecture" = "$candidate" ]; then
|
|
architecture_supported=1
|
|
break
|
|
fi
|
|
done
|
|
if [ "$architecture_supported" -ne 1 ]; then
|
|
printf 'Unsupported Genesis architecture: %s\n' "$architecture" >&2
|
|
exit 2
|
|
fi
|
|
"$KAS" build "$oe_dir/kas/$architecture.yml"
|
|
done
|