Skip to content

Commit

Permalink
Skip cloning of camera-streamer on pi5 and ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
mryel00 committed Jan 6, 2024
1 parent 3bdd9f6 commit 807f1b5
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,24 @@ is_bookworm() {
fi
}

is_pi5() {
if [[ -f /proc/device-tree/model ]] &&
grep -q "Raspberry Pi 5" /proc/device-tree/model; then
echo "1"
else
echo "0"
fi
}

is_ubuntu_arm() {
if [[ "$(is_raspberry_pi)" = "1" ]] &&
grep -q "ubuntu" /etc/os-release; then
echo "1"
else
echo "0"
fi
}

### Get avail mem
get_avail_mem() {
grep "MemTotal" /proc/meminfo | awk '{print $2}'
Expand Down Expand Up @@ -114,7 +132,10 @@ clone_ustreamer() {
clone_cstreamer() {
## Special handling because only supported on Raspberry Pi
[[ -n "${CROWSNEST_UNATTENDED}" ]] || CROWSNEST_UNATTENDED="0"
if [[ "$(is_raspberry_pi)" = "0" ]] && [[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
if { [[ "$(is_raspberry_pi)" = "0" ]] ||
[[ "$(is_pi5)" = "1" ]] ||
[[ "$(is_ubuntu_arm)" = "1" ]]; } &&
[[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
printf "WARN: Cloning camera-streamer skipped! Device is not supported!"
return
fi
Expand Down

0 comments on commit 807f1b5

Please sign in to comment.