File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ function upgrade_docker_containers() {
233
233
234
234
sudo -u ${USER} \
235
235
DOCKER_TAG=" ${DOCKER_TAG} " \
236
+ GIT_BRANCH=" ${BRANCH} " \
236
237
" ${UPGRADE_SCRIPT_PATH} "
237
238
}
238
239
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export MY_IP=$(ip -4 route get 8.8.8.8 | awk {'print $7'} | tr -d '\n')
8
8
TOTAL_MEMORY_KB=$( grep MemTotal /proc/meminfo | awk {' print $2' })
9
9
export VIEWER_MEMORY_LIMIT_KB=$( echo " $TOTAL_MEMORY_KB " \* 0.8 | bc)
10
10
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} "
12
12
13
13
MODE=" ${MODE:- pull} "
14
14
if [[ ! " $MODE " =~ ^(pull| build)$ ]]; then
@@ -33,7 +33,17 @@ elif grep -qF "Raspberry Pi 5" /proc/device-tree/model || grep -qF "Compute Modu
33
33
export DEVICE_TYPE=" pi5"
34
34
elif grep -qF " Raspberry Pi 4" /proc/device-tree/model || grep -qF " Compute Module 4" /proc/device-tree/model; then
35
35
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
37
47
else
38
48
export DEVICE_TYPE=" pi4"
39
49
fi
You can’t perform that action at this time.
0 commit comments