cloudron-setup: add AVX check for 7.6 and beyond
This commit is contained in:
@@ -8,6 +8,11 @@ function exitHandler() {
|
||||
|
||||
trap exitHandler EXIT
|
||||
|
||||
vergte() {
|
||||
greater_version=$(echo -e "$1\n$2" | sort -rV | head -n1)
|
||||
[[ "$1" == "${greater_version}" ]] && return 0 || return 1
|
||||
}
|
||||
|
||||
# change this to a hash when we make a upgrade release
|
||||
readonly LOG_FILE="/var/log/cloudron-setup.log"
|
||||
readonly MINIMUM_DISK_SIZE_GB="18" # this is the size of "/" and required to fit in docker images 18 is a safe bet for different reporting on 20GB min
|
||||
@@ -196,6 +201,13 @@ else
|
||||
version="${requestedVersion}"
|
||||
fi
|
||||
|
||||
if vergte "${version}" "7.5.99"; then
|
||||
if ! grep -q avx /proc/cpuinfo; then
|
||||
echo "Cloudron version ${version} requires AVX support in the CPU. No avx found in /proc/cpuinfo"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! sourceTarballUrl=$(echo "${releaseJson}" | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["info"]["sourceTarballUrl"])'); then
|
||||
echo "No source code for version '${requestedVersion:-latest}'"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user