From 60194c3fc7231e2664899fb9d6f6b21d4de9cf74 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Thu, 30 Nov 2023 11:18:04 +0100 Subject: [PATCH 01/17] feat: pin streaming backends to specific commits This will pin the compiled versions of the backends to a specifc commit that we tested ourselves. Those commit hashes will be updated manually with a crowsnest update, after testing. To install the newest version of the backend. Someone has to run `make update` inside the crowsnest directory. Signed-off-by: Patrick Gehrsitz --- backend_versions.sh | 22 +++++++ bin/build.sh | 121 ++++++++++++++++++++++++++++++++++++++- tools/libs/build_apps.sh | 33 +---------- 3 files changed, 141 insertions(+), 35 deletions(-) create mode 100644 backend_versions.sh diff --git a/backend_versions.sh b/backend_versions.sh new file mode 100644 index 00000000..d1a616b0 --- /dev/null +++ b/backend_versions.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +#### crowsnest - A webcam Service for multiple Cams and Stream Services. +#### +#### Written by Patrick Gehrsitz aka mryel00 +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/crowsnest +#### +#### This File is distributed under GPLv3 +#### + +# shellcheck enable=require-variable-braces + +# Exit on errors +set -Ee + +# Debug +# set -x + +CROWSNEST_USTREAMER_REPO_COMMIT="81756811f3c925174f05300a9301bb722b9cbfb5" +CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MASTER="fe701b83da35598af4fc1d77c717c8a67cac9edd" +CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN="bc231917d811e4a6661fc0b01b3e3750c6babd59" diff --git a/bin/build.sh b/bin/build.sh index b386d894..f3204e00 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -3,7 +3,9 @@ #### crowsnest - A webcam Service for multiple Cams and Stream Services. #### #### Written by Stephan Wendel aka KwadFan -#### Copyright 2021 - till today +#### Copyright 2021 - 2023 +#### Co-authored by Patrick Gehrsitz aka mryel00 +#### Copyright 2023 - till today #### https://github.com/mainsail-crew/crowsnest #### #### This File is distributed under GPLv3 @@ -24,8 +26,10 @@ set -Ee # Base Path BASE_CN_BIN_PATH="$(dirname "$(readlink -f "${0}")")" +. "${BASE_CN_BIN_PATH}/../backend_versions.sh" + # Clone Flags -CLONE_FLAGS=(--depth=1 --single-branch) +CLONE_FLAGS=(--single-branch) # Ustreamer repo USTREAMER_PATH="ustreamer" @@ -52,6 +56,38 @@ ALL_PATHS=( "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" ) +### Messages +msg_build() { + printf "%s" "${1}" +} + +error_msg_build() { + msg_build "Something went wrong!\nPlease copy the latest output, head over to\n" + msg_build "\thttps://discord.gg/mainsail\n" + msg_build "and open a ticket in #supportforum..." +} + +status_msg_build() { + local msg status + msg="${1}" + status="${2}" + printf "%s\r" "${msg}" + if [[ "${status}" == "0" ]]; then + printf "%s [\e[32mOK\e[0m]\n" "${msg}" + fi + if [[ "${status}" == "1" ]]; then + printf "%s [\e[31mFAILED\e[0m]\n" "${msg}" + error_msg_build + exit 1 + fi + if [[ "${status}" == "2" ]]; then + printf "%s [\e[33mSKIPPED\e[0m]\n" "${msg}" + fi + if [[ "${status}" == "3" ]]; then + printf "%s [\e[33mFAILED\e[0m]\n" "${msg}" + fi +} + # Helper messages show_help() { printf "Usage %s [options]\n" "$(basename "${0}")" @@ -79,6 +115,65 @@ is_bookworm() { fi } +is_ubuntu_arm() { + if [[ "$(is_raspberry_pi)" = "1" ]] && + grep -q "ubuntu" /etc/os-release; then + echo "1" + else + echo "0" + fi +} + +test_load_module() { + if modprobe -n "${1}" &> /dev/null; then + echo 1 + else + echo 0 + fi +} + +shallow_cs_dependencies_check() { + msg_build "Checking for camera-streamer dependencies ...\n" + + msg_build "Checking if device is a Raspberry Pi ...\n" + if [[ "$(is_raspberry_pi)" = "0" ]]; then + status_msg_build "Checking if device is a Raspberry Pi ..." "3" + msg_build "This device is not a Raspberry Pi therefore camera-streeamer cannot be installed ..." + return 1 + fi + status_msg_build "Checking if device is a Raspberry Pi ..." "0" + + msg_build "Checking if device is not running Ubuntu ...\n" + if [[ "$(is_ubuntu_arm)" = "1" ]]; then + status_msg_build "Checking if device is not running Ubuntu ..." "3" + msg_build "This device is running Ubuntu therefore camera-streeamer cannot be installed ..." + return 1 + fi + status_msg_build "Checking if device is not running Ubuntu ..." "0" + + msg_build "Checking for required kernel module ...\n" + SHALLOW_CHECK_MODULESLIST="bcm2835_codec" + if [[ "$(test_load_module "${SHALLOW_CHECK_MODULESLIST}")" = "0" ]]; then + status_msg_build "Checking for required kernel module ..." "3" + msg_build "Not all required kernel modules for camera-streamer can be loaded ..." + return 1 + fi + status_msg_build "Checking for required kernel module ..." "0" + + msg_build "Checking for required packages ...\n" + # Update the number below if you update SHALLOW_CHECK_PKGLIST + SHALLOW_CHECK_PKGLIST="^(libavformat-dev|libavutil-dev|libavcodec-dev|liblivemedia-dev|libcamera-dev|libcamera-apps-lite)$" + if [[ $(apt-cache search --names-only "${SHALLOW_CHECK_PKGLIST}" | wc -l) -lt 6 ]]; then + status_msg_build "Checking for required packages ..." "3" + msg_build "Not all required packages for camera-streamer can be installed ..." + return 1 + fi + status_msg_build "Checking for required packages ..." "0" + + status_msg_build "Checking for camera-streamer dependencies ..." "0" + return 0 +} + ### Get avail mem get_avail_mem() { grep "MemTotal" /proc/meminfo | awk '{print $2}' @@ -108,29 +203,49 @@ clone_ustreamer() { -b "${CROWSNEST_USTREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" + + git -C "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ + reset --hard "${CROWSNEST_USTREAMER_REPO_COMMIT}" } ### Clone camera-streamer 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 CROWSNEST_UNATTENDED is 1, CN_INSTALL_CS should be already set + if [[ "${CROWSNEST_UNATTENDED}" = "0" ]] && [[ -n "${CN_INSTALL_CS}" ]]; then + if shallow_cs_dependencies_check; then + CN_INSTALL_CS="1" + else + CN_INSTALL_CS="0" + fi + fi + + if [[ "${CN_INSTALL_CS}" = "0" ]]; then printf "WARN: Cloning camera-streamer skipped! Device is not supported!" return fi + if [[ -d "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" ]]; then printf "%s already exist ... [SKIPPED]\n" "${CSTREAMER_PATH}" return fi + + CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MASTER}" if [[ "$(is_bookworm)" = "1" ]]; then printf "\nBookworm detected!\n" printf "Using main branch of camera-streamer for Bookworm ...\n\n" CROWSNEST_CAMERA_STREAMER_REPO_BRANCH="main" + CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN}" fi git clone "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" \ -b "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" --recursive + + git -C "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ + reset --hard "${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT}" } ### Clone Apps diff --git a/tools/libs/build_apps.sh b/tools/libs/build_apps.sh index 6575b4b8..de8f86e7 100755 --- a/tools/libs/build_apps.sh +++ b/tools/libs/build_apps.sh @@ -19,38 +19,7 @@ set -Ee # Debug # set -x -clone_ustreamer() { - ## remove bin/ustreamer if exist - if [[ -d bin/ustreamer ]]; then - rm -rf bin/ustreamer - fi - sudo -u "${BASE_USER}" \ - git clone "${CROWSNEST_USTREAMER_REPO_SHIP}" \ - -b "${CROWSNEST_USTREAMER_REPO_BRANCH}" \ - --depth=1 --single-branch bin/ustreamer -} - -clone_cstreamer() { - ## remove bin/ustreamer if exist - if [[ -d bin/camera-streamer ]]; then - rm -rf bin/camera-streamer - fi - sudo -u "${BASE_USER}" \ - git clone "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" --recursive \ - -b "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" \ - --depth=1 --single-branch bin/camera-streamer -} - build_apps() { - msg "Build dependend Stream Apps ..." - msg "Cloning ustreamer repository ..." - clone_ustreamer - ## Detect Image build for Raspberrys - if [[ "${CN_INSTALL_CS}" = "1" ]]; then - msg "Cloning camera-streamer repository ..." - clone_cstreamer - else - msg "Install of camera-streamer skipped, only supported on Raspberry SBC's! ... " - fi + sudo -u "${BASE_USER}" "${PWD}"/bin/build.sh --reclone sudo -u "${BASE_USER}" "${PWD}"/bin/build.sh --build } From 2679663c2f418a7a46c2fb93998fb8c4a0720b2b Mon Sep 17 00:00:00 2001 From: mryel00 Date: Thu, 30 Nov 2023 11:26:23 +0100 Subject: [PATCH 02/17] fix: fix backend_versions.sh file permissions Signed-off-by: mryel00 --- backend_versions.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 backend_versions.sh diff --git a/backend_versions.sh b/backend_versions.sh old mode 100644 new mode 100755 From dc9b7b447ddf52f853a0bfe7a35d420797b922ff Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Thu, 30 Nov 2023 15:52:04 +0100 Subject: [PATCH 03/17] chore(shellcheck): ignore backend_versions.sh Signed-off-by: Patrick Gehrsitz --- .github/workflows/shellcheck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index fcb2f058..ecafe8b3 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -30,4 +30,5 @@ jobs: SHELLCHECK_OPTS: -ax -s bash with: ignore_paths: custompios + ignore_names: backend_versions.sh format: tty \ No newline at end of file From bd6f76cabc5839e8e606beb3ecf60a3e923be321 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 12:14:03 +0100 Subject: [PATCH 04/17] fix: add messages for cloning and resetting Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/build.sh b/bin/build.sh index f3204e00..562b100a 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -199,11 +199,14 @@ clone_ustreamer() { printf "%s already exist ... [SKIPPED]\n" "${USTREAMER_PATH}" return fi + + msg_build "Cloning ustreamer ...\n" git clone "${CROWSNEST_USTREAMER_REPO_SHIP}" \ -b "${CROWSNEST_USTREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" + msg_build "Reset to specified ustreamer commit ...\n" git -C "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ reset --hard "${CROWSNEST_USTREAMER_REPO_COMMIT}" } @@ -239,11 +242,14 @@ clone_cstreamer() { CROWSNEST_CAMERA_STREAMER_REPO_BRANCH="main" CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN}" fi + + msg_build "Cloning camera-streamer ...\n" git clone "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" \ -b "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" --recursive + msg_build "Reset to specified camera-streamer commit ...\n" git -C "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ reset --hard "${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT}" } From 57314069d49037273e5c93f711492495de4a64be Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 12:18:38 +0100 Subject: [PATCH 05/17] refactor: remove msg_build Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index 562b100a..df159c0c 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -57,14 +57,10 @@ ALL_PATHS=( ) ### Messages -msg_build() { - printf "%s" "${1}" -} - error_msg_build() { - msg_build "Something went wrong!\nPlease copy the latest output, head over to\n" - msg_build "\thttps://discord.gg/mainsail\n" - msg_build "and open a ticket in #supportforum..." + printf "Something went wrong!\nPlease copy the latest output, head over to\n" + printf "\thttps://discord.gg/mainsail\n" + printf "and open a ticket in #supportforum..." } status_msg_build() { @@ -133,39 +129,39 @@ test_load_module() { } shallow_cs_dependencies_check() { - msg_build "Checking for camera-streamer dependencies ...\n" + printf "Checking for camera-streamer dependencies ...\n" - msg_build "Checking if device is a Raspberry Pi ...\n" + printf "Checking if device is a Raspberry Pi ...\n" if [[ "$(is_raspberry_pi)" = "0" ]]; then status_msg_build "Checking if device is a Raspberry Pi ..." "3" - msg_build "This device is not a Raspberry Pi therefore camera-streeamer cannot be installed ..." + printf "This device is not a Raspberry Pi therefore camera-streeamer cannot be installed ..." return 1 fi status_msg_build "Checking if device is a Raspberry Pi ..." "0" - msg_build "Checking if device is not running Ubuntu ...\n" + printf "Checking if device is not running Ubuntu ...\n" if [[ "$(is_ubuntu_arm)" = "1" ]]; then status_msg_build "Checking if device is not running Ubuntu ..." "3" - msg_build "This device is running Ubuntu therefore camera-streeamer cannot be installed ..." + printf "This device is running Ubuntu therefore camera-streeamer cannot be installed ..." return 1 fi status_msg_build "Checking if device is not running Ubuntu ..." "0" - msg_build "Checking for required kernel module ...\n" + printf "Checking for required kernel module ...\n" SHALLOW_CHECK_MODULESLIST="bcm2835_codec" if [[ "$(test_load_module "${SHALLOW_CHECK_MODULESLIST}")" = "0" ]]; then status_msg_build "Checking for required kernel module ..." "3" - msg_build "Not all required kernel modules for camera-streamer can be loaded ..." + printf "Not all required kernel modules for camera-streamer can be loaded ..." return 1 fi status_msg_build "Checking for required kernel module ..." "0" - msg_build "Checking for required packages ...\n" + printf "Checking for required packages ...\n" # Update the number below if you update SHALLOW_CHECK_PKGLIST SHALLOW_CHECK_PKGLIST="^(libavformat-dev|libavutil-dev|libavcodec-dev|liblivemedia-dev|libcamera-dev|libcamera-apps-lite)$" if [[ $(apt-cache search --names-only "${SHALLOW_CHECK_PKGLIST}" | wc -l) -lt 6 ]]; then status_msg_build "Checking for required packages ..." "3" - msg_build "Not all required packages for camera-streamer can be installed ..." + printf "Not all required packages for camera-streamer can be installed ..." return 1 fi status_msg_build "Checking for required packages ..." "0" @@ -200,13 +196,13 @@ clone_ustreamer() { return fi - msg_build "Cloning ustreamer ...\n" + printf "Cloning ustreamer ...\n" git clone "${CROWSNEST_USTREAMER_REPO_SHIP}" \ -b "${CROWSNEST_USTREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" - msg_build "Reset to specified ustreamer commit ...\n" + printf "Reset to specified ustreamer commit ...\n" git -C "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ reset --hard "${CROWSNEST_USTREAMER_REPO_COMMIT}" } @@ -243,13 +239,13 @@ clone_cstreamer() { CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN}" fi - msg_build "Cloning camera-streamer ...\n" + printf "Cloning camera-streamer ...\n" git clone "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" \ -b "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" --recursive - msg_build "Reset to specified camera-streamer commit ...\n" + printf "Reset to specified camera-streamer commit ...\n" git -C "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ reset --hard "${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT}" } From c259194b112a7e441d9589c41ca23ee4c5c397ae Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 12:19:51 +0100 Subject: [PATCH 06/17] fix: change to shallow submodule clone Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index df159c0c..29aee366 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -243,7 +243,7 @@ clone_cstreamer() { git clone "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" \ -b "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ - "${CLONE_FLAGS[@]}" --recursive + "${CLONE_FLAGS[@]}" --recurse-submodules --shallow-submodules printf "Reset to specified camera-streamer commit ...\n" git -C "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ From 17165ae9eb6298707933203441e46ce8d3dfe946 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 13:04:30 +0100 Subject: [PATCH 07/17] fix(shellcheck): move backend_versions and source it correctly Signed-off-by: Patrick Gehrsitz --- .github/workflows/shellcheck.yml | 1 - bin/build.sh | 2 +- backend_versions.sh => resources/backend_versions.txt | 0 3 files changed, 1 insertion(+), 2 deletions(-) rename backend_versions.sh => resources/backend_versions.txt (100%) mode change 100755 => 100644 diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index ecafe8b3..fcb2f058 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -30,5 +30,4 @@ jobs: SHELLCHECK_OPTS: -ax -s bash with: ignore_paths: custompios - ignore_names: backend_versions.sh format: tty \ No newline at end of file diff --git a/bin/build.sh b/bin/build.sh index 29aee366..91f07f3d 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -26,7 +26,7 @@ set -Ee # Base Path BASE_CN_BIN_PATH="$(dirname "$(readlink -f "${0}")")" -. "${BASE_CN_BIN_PATH}/../backend_versions.sh" +. "${BASE_BIN_PATH%%/bin/}/resources/backend_versions.txt" # Clone Flags CLONE_FLAGS=(--single-branch) diff --git a/backend_versions.sh b/resources/backend_versions.txt old mode 100755 new mode 100644 similarity index 100% rename from backend_versions.sh rename to resources/backend_versions.txt From 4ec795a9b984e8e15ada39f7dc80ac23bba83586 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 13:11:18 +0100 Subject: [PATCH 08/17] chore: remove unnecessary code Signed-off-by: Patrick Gehrsitz --- resources/backend_versions.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/resources/backend_versions.txt b/resources/backend_versions.txt index d1a616b0..399c842e 100644 --- a/resources/backend_versions.txt +++ b/resources/backend_versions.txt @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - #### crowsnest - A webcam Service for multiple Cams and Stream Services. #### #### Written by Patrick Gehrsitz aka mryel00 @@ -9,14 +7,6 @@ #### This File is distributed under GPLv3 #### -# shellcheck enable=require-variable-braces - -# Exit on errors -set -Ee - -# Debug -# set -x - CROWSNEST_USTREAMER_REPO_COMMIT="81756811f3c925174f05300a9301bb722b9cbfb5" CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MASTER="fe701b83da35598af4fc1d77c717c8a67cac9edd" CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN="bc231917d811e4a6661fc0b01b3e3750c6babd59" From 2b9cd32b4f79699d839a928f06c9466f9060204b Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 14:07:59 +0100 Subject: [PATCH 09/17] fix: fix sourcing of backends_versions.txt Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index 91f07f3d..b75a25f6 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -26,7 +26,7 @@ set -Ee # Base Path BASE_CN_BIN_PATH="$(dirname "$(readlink -f "${0}")")" -. "${BASE_BIN_PATH%%/bin/}/resources/backend_versions.txt" +. "${BASE_BIN_PATH/bin/resources}/backend_versions.txt" # Clone Flags CLONE_FLAGS=(--single-branch) From 6bd4a48f35cc52d6a48c4532c4a825c1d723e031 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 14:08:46 +0100 Subject: [PATCH 10/17] style: add some newlines Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index b75a25f6..e85e7c9f 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -196,13 +196,13 @@ clone_ustreamer() { return fi - printf "Cloning ustreamer ...\n" + printf "\nCloning ustreamer ...\n" git clone "${CROWSNEST_USTREAMER_REPO_SHIP}" \ -b "${CROWSNEST_USTREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" - printf "Reset to specified ustreamer commit ...\n" + printf "\nReset to specified ustreamer commit ...\n" git -C "${BASE_CN_BIN_PATH}"/"${USTREAMER_PATH}" \ reset --hard "${CROWSNEST_USTREAMER_REPO_COMMIT}" } @@ -239,13 +239,13 @@ clone_cstreamer() { CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN}" fi - printf "Cloning camera-streamer ...\n" + printf "\nCloning camera-streamer ...\n" git clone "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" \ -b "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" \ "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ "${CLONE_FLAGS[@]}" --recurse-submodules --shallow-submodules - printf "Reset to specified camera-streamer commit ...\n" + printf "\nReset to specified camera-streamer commit ...\n" git -C "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" \ reset --hard "${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT}" } From 1d57e6c48170c8341e14d49a2e75a9ae25700290 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 14:14:49 +0100 Subject: [PATCH 11/17] fix: fix sourcing of backends_versions.txt Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index e85e7c9f..9f577392 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -26,7 +26,7 @@ set -Ee # Base Path BASE_CN_BIN_PATH="$(dirname "$(readlink -f "${0}")")" -. "${BASE_BIN_PATH/bin/resources}/backend_versions.txt" +. "${BASE_CN_BIN_PATH%%/bin}/resources/backend_versions.txt" # Clone Flags CLONE_FLAGS=(--single-branch) From 394cbb22720e2681396f1d372d23e1170c642b43 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 14:16:46 +0100 Subject: [PATCH 12/17] style: remove a newline Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index 9f577392..5434ba1d 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -234,7 +234,7 @@ clone_cstreamer() { CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MASTER}" if [[ "$(is_bookworm)" = "1" ]]; then printf "\nBookworm detected!\n" - printf "Using main branch of camera-streamer for Bookworm ...\n\n" + printf "Using main branch of camera-streamer for Bookworm ...\n" CROWSNEST_CAMERA_STREAMER_REPO_BRANCH="main" CROWSNEST_CAMERA_STREAMER_REPO_COMMIT="${CROWSNEST_CAMERA_STREAMER_REPO_COMMIT_MAIN}" fi From 9e1f10687cec8046e49d2a2335e7ff4ebb67a9fa Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 14:20:42 +0100 Subject: [PATCH 13/17] style: add a newline Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index 5434ba1d..36339fd9 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -129,7 +129,7 @@ test_load_module() { } shallow_cs_dependencies_check() { - printf "Checking for camera-streamer dependencies ...\n" + printf "\nChecking for camera-streamer dependencies ...\n" printf "Checking if device is a Raspberry Pi ...\n" if [[ "$(is_raspberry_pi)" = "0" ]]; then From fb67b63f9ad675ce789af3ed0e7d1764bd350884 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 14:21:16 +0100 Subject: [PATCH 14/17] fix: fix camera-streamer dependencies check Signed-off-by: Patrick Gehrsitz --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index 36339fd9..08fc203f 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -213,7 +213,7 @@ clone_cstreamer() { [[ -n "${CROWSNEST_UNATTENDED}" ]] || CROWSNEST_UNATTENDED="0" ## If CROWSNEST_UNATTENDED is 1, CN_INSTALL_CS should be already set - if [[ "${CROWSNEST_UNATTENDED}" = "0" ]] && [[ -n "${CN_INSTALL_CS}" ]]; then + if [[ "${CROWSNEST_UNATTENDED}" = "0" ]] && [[ -z "${CN_INSTALL_CS}" ]]; then if shallow_cs_dependencies_check; then CN_INSTALL_CS="1" else From 3a6965503c0f272a2b8b529ebf2daeab74028f48 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 16:36:44 +0100 Subject: [PATCH 15/17] fix: add export of CN_INSTALL_CS Signed-off-by: Patrick Gehrsitz --- tools/libs/build_apps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libs/build_apps.sh b/tools/libs/build_apps.sh index de8f86e7..9cc830ca 100755 --- a/tools/libs/build_apps.sh +++ b/tools/libs/build_apps.sh @@ -20,6 +20,7 @@ set -Ee # set -x build_apps() { + export CN_INSTALL_CS sudo -u "${BASE_USER}" "${PWD}"/bin/build.sh --reclone sudo -u "${BASE_USER}" "${PWD}"/bin/build.sh --build } From a386d32fcec1a39ab60eb6ba3056b9033377a827 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Fri, 1 Dec 2023 17:15:18 +0100 Subject: [PATCH 16/17] fix: fix export Signed-off-by: Patrick Gehrsitz --- tools/libs/build_apps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/build_apps.sh b/tools/libs/build_apps.sh index 9cc830ca..bad40c77 100755 --- a/tools/libs/build_apps.sh +++ b/tools/libs/build_apps.sh @@ -21,6 +21,6 @@ set -Ee build_apps() { export CN_INSTALL_CS - sudo -u "${BASE_USER}" "${PWD}"/bin/build.sh --reclone + sudo -E -u "${BASE_USER}" "${PWD}"/bin/build.sh --reclone sudo -u "${BASE_USER}" "${PWD}"/bin/build.sh --build } From b0709702f677ffde1f102db08ad79371f6c95165 Mon Sep 17 00:00:00 2001 From: mryel00 Date: Wed, 28 Feb 2024 15:30:23 +0000 Subject: [PATCH 17/17] docs(changelog): update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d4a3eb9..7508fefd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ # Changelog All notable changes to Crowsnest will be documented in this file. +## [4.1.5](https://github.com/mainsail-crew/crowsnest/releases/tag/v4.1.5) - 2024-02-28 +### Bug Fixes and Improvements + +- Fix ustreamer binary path for v5.52 changes ([#245](https://github.com/mainsail-crew/crowsnest/pull/245)) + ## [4.1.4](https://github.com/mainsail-crew/crowsnest/releases/tag/v4.1.4) - 2024-02-17 ### Bug Fixes and Improvements