Skip to content

Commit bba8f60

Browse files
fix: stick to pi4 for Anthias version v0.19.5 and older (#2251)
1 parent ad26782 commit bba8f60

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

bin/install.sh

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ function upgrade_docker_containers() {
233233

234234
sudo -u ${USER} \
235235
DOCKER_TAG="${DOCKER_TAG}" \
236+
GIT_BRANCH="${BRANCH}" \
236237
"${UPGRADE_SCRIPT_PATH}"
237238
}
238239

bin/upgrade_containers.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export MY_IP=$(ip -4 route get 8.8.8.8 | awk {'print $7'} | tr -d '\n')
88
TOTAL_MEMORY_KB=$(grep MemTotal /proc/meminfo | awk {'print $2'})
99
export VIEWER_MEMORY_LIMIT_KB=$(echo "$TOTAL_MEMORY_KB" \* 0.8 | bc)
1010
export SHM_SIZE_KB="$(echo "$TOTAL_MEMORY_KB" \* 0.3 | bc | cut -d'.' -f1)"
11-
export GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
11+
GIT_BRANCH="${GIT_BRANCH:-master}"
1212

1313
MODE="${MODE:-pull}"
1414
if [[ ! "$MODE" =~ ^(pull|build)$ ]]; then
@@ -33,7 +33,17 @@ elif grep -qF "Raspberry Pi 5" /proc/device-tree/model || grep -qF "Compute Modu
3333
export DEVICE_TYPE="pi5"
3434
elif grep -qF "Raspberry Pi 4" /proc/device-tree/model || grep -qF "Compute Module 4" /proc/device-tree/model; then
3535
if [ "$(getconf LONG_BIT)" = "64" ]; then
36-
export DEVICE_TYPE="pi4-64"
36+
if [ "$GIT_BRANCH" = "master" ]; then
37+
export DEVICE_TYPE="pi4-64"
38+
else
39+
# Remove 'v' prefix if present for version comparison
40+
VERSION_NUM=${GIT_BRANCH#v}
41+
if printf '%s\n' "$VERSION_NUM" "0.19.5" | sort -V -C; then
42+
export DEVICE_TYPE="pi4"
43+
else
44+
export DEVICE_TYPE="pi4-64"
45+
fi
46+
fi
3747
else
3848
export DEVICE_TYPE="pi4"
3949
fi

0 commit comments

Comments
 (0)