Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cs cannot be built on Armbian, so let's not depend on it #288

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ is_ubuntu_arm() {
fi
}

is_armbian() {
if grep -q "Armbian" /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 @@ -136,7 +144,8 @@ clone_cstreamer() {
[[ -n "${CROWSNEST_UNATTENDED}" ]] || CROWSNEST_UNATTENDED="0"
if { [[ "$(is_raspberry_pi)" = "0" ]] ||
[[ "$(is_pi5)" = "1" ]] ||
[[ "$(is_ubuntu_arm)" = "1" ]]; } &&
[[ "$(is_ubuntu_arm)" = "1" ]] ||
[[ "$(is_armbian)" = "1" ]]; } &&
[[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
printf "Device is not supported! Cloning camera-streamer ... [SKIPPED]\n"
return
Expand Down
1 change: 1 addition & 0 deletions libs/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function check_apps {
## Avoid dependency check if non rpi sbc
if [[ "$(is_raspberry_pi)" = "1" ]] &&
[[ "$(is_ubuntu_arm)" = "0" ]] &&
[[ "$(is_armbian)" = "0" ]] &&
[[ "$(is_pi5)" = "0" ]]; then
if [[ -x "${BASE_CN_PATH}/${cstreamer}" ]]; then
log_msg "Dependency: '${cstreamer##*/}' found in ${cstreamer}."
Expand Down
8 changes: 8 additions & 0 deletions libs/hwhandler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,11 @@ is_ubuntu_arm() {
echo "0"
fi
}

is_armbian() {
if grep -q "Armbian" /etc/os-release; then
echo "1"
else
echo "0"
fi
}
1 change: 1 addition & 0 deletions libs/init_stream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function construct_streamer {
[mM]ulti | camera-streamer)
if [[ "$(is_raspberry_pi)" = "1" ]] &&
[[ "$(is_ubuntu_arm)" = "0" ]] &&
[[ "$(is_armbian)" = "0" ]] &&
[[ "$(is_pi5)" = "0" ]]; then
MULTI_INSTANCES+=( "${cams}" )
else
Expand Down
1 change: 1 addition & 0 deletions libs/versioncontrol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ versioncontrol() {
local cur_ver avail_ver
if [[ "$(is_raspberry_pi)" = "1" ]] &&
[[ "$(is_ubuntu_arm)" = "0" ]] &&
[[ "$(is_armbian)" = "0" ]] &&
[[ "$(is_pi5)" = "0" ]]; then
pushd "${BASE_CN_PATH}"/bin/camera-streamer &> /dev/null || exit 1
avail_ver="($(git describe --tags --always))"
Expand Down
16 changes: 16 additions & 0 deletions tools/libs/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ is_ubuntu_arm() {
fi
}

is_armbian() {
if grep -q "Armbian" /etc/os-release; then
echo "1"
else
echo "0"
fi
}

is_speederpad() {
if grep -q "Ubuntu 20.04." /etc/os-release &&
[[ "$(uname -rm)" = "4.9.191 aarch64" ]]; then
Expand Down Expand Up @@ -129,6 +137,14 @@ shallow_cs_dependencies_check() {
fi
status_msg "Checking if device is not running Ubuntu ..." "0"

msg "Checking if device is not running Armbian ...\n"
if [[ "$(is_armbian)" = "1" ]]; then
status_msg "Checking if device is not running Armbian ..." "3"
msg "This device is running Armbian therefore camera-streeamer cannot be installed ..."
return 1
fi
status_msg "Checking if device is not running Armbian ..." "0"

msg "Checking for required kernel module ...\n"
SHALLOW_CHECK_MODULESLIST="bcm2835_codec"
if [[ "$(test_load_module ${SHALLOW_CHECK_MODULESLIST})" = "0" ]]; then
Expand Down