* Fix makefile flags on low memory devices (#124) * Fix `makefile` flags on low memory devices On devices with less than 512MB existing devices will use `-j2` due to wrong condition. * docs: Update index with correct heading and link to backends (#131) This is a follow-up to #108 and fixes heading and hyperlink to the list of backends * Typo in `core.sh` (#138) * Fix makefile flags on low memory devices (#124) (#125) * Fix `makefile` flags on low memory devices On devices with less than 512MB existing devices will use `-j2` due to wrong condition. Co-authored-by: Kamil Trzciński <ayufan@ayufan.eu> * Typo in `core.sh` 'Dependencys' --> dependencies --------- Co-authored-by: Stephan Wendel <43513802+KwadFan@users.noreply.github.com> Co-authored-by: Kamil Trzciński <ayufan@ayufan.eu> * Fix makefile flags on low memory devices (#124) (#125) (#144) * Fix `makefile` flags on low memory devices On devices with less than 512MB existing devices will use `-j2` due to wrong condition. Co-authored-by: Kamil Trzciński <ayufan@ayufan.eu> * docs(messages.sh): fix typos, improve spelling (#145) * feat: add legacy cam support (#146) * feat: add legacy cam support Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * feat: add blockyfix Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * fix: add ustreamer legacy cam workaround Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> --------- Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * Fix makefile flags on low memory devices (#124) (#125) (#147) * Fix `makefile` flags on low memory devices On devices with less than 512MB existing devices will use `-j2` due to wrong condition. Co-authored-by: Kamil Trzciński <ayufan@ayufan.eu> * fix: fix make config empty path (#148) Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * fix: fix default_path_msg function name (#149) * fix: fix default_path_msg function name Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * fix: fix message Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> --------- Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * fix: fix libcamera-apps-lite not getting updated (#160) libcamera-apps-lite is needed for libcamera-hello. Crowsnest uses libcamera-hello to detected raspicams Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * fix: fix Shellcheck test error (#153) * fix: fix Shellcheck test error Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * style: remove empty condition Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> --------- Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * fix: fix CustomPiOS docker build error (#158) This should skip any check of `SUDO_USER` Tested with Win & Linux host with Docker Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> --------- Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> Co-authored-by: Kamil Trzciński <ayufan@ayufan.eu> Co-authored-by: DeviousFusion <dj3tusk@gmail.com> Co-authored-by: Sergei <67871383+slepiavka@users.noreply.github.com> Co-authored-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com>
161 lines
3.6 KiB
Bash
Executable File
161 lines
3.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
#### crowsnest - A webcam Service for multiple Cams and Stream Services.
|
|
####
|
|
#### Written by Stephan Wendel aka KwadFan <me@stephanwe.de>
|
|
#### Copyright 2021 - till today
|
|
#### https://github.com/mainsail-crew/crowsnest
|
|
####
|
|
#### This File is distributed under GPLv3
|
|
####
|
|
|
|
# shellcheck enable=require-variable-braces
|
|
# shellcheck source-path=SCRIPTDIR
|
|
|
|
# Exit on errors
|
|
set -Ee
|
|
|
|
# Debug
|
|
# set -x
|
|
|
|
|
|
## Global Vars
|
|
SRC_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd -P)"
|
|
[[ -n "${CROWSNEST_UNATTENDED}" ]] || CROWSNEST_UNATTENDED="0"
|
|
|
|
main() {
|
|
. "${SRC_DIR}/libs/build_apps.sh"
|
|
. "${SRC_DIR}/libs/config.sh"
|
|
. "${SRC_DIR}/libs/core.sh"
|
|
. "${SRC_DIR}/libs/interactive.sh"
|
|
. "${SRC_DIR}/libs/messages.sh"
|
|
. "${SRC_DIR}/libs/set_gpumem.sh"
|
|
. "${SRC_DIR}/libs/update_manager.sh"
|
|
|
|
|
|
if [[ "${DEBIAN_FRONTEND}" != "noninteractive" ]]; then
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
fi
|
|
|
|
if [[ "${SUDO_USER}" = "root" ]]; then
|
|
not_as_root_msg
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -z "${SUDO_USER}" ]] && [[ "${CROWSNEST_UNATTENDED}" != "1" ]]; then
|
|
need_sudo_msg
|
|
exit 1
|
|
fi
|
|
|
|
[[ -n "${BASE_USER}" ]] || BASE_USER="${SUDO_USER}"
|
|
|
|
|
|
if [[ "$(is_buster)" = "1" ]]; then
|
|
not_supported_msg
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$(is_raspbian)" = "1" ]]; then
|
|
link_pkglist_rpi
|
|
fi
|
|
|
|
if [[ "$(is_raspbian)" = "0" ]]; then
|
|
link_pkglist_generic
|
|
fi
|
|
|
|
welcome_msg
|
|
|
|
msg "Running apt-get update first ...\n"
|
|
if run_apt_update; then
|
|
status_msg "Running apt-get update first ..." "0"
|
|
else
|
|
status_msg "Running apt-get update first ..." "1"
|
|
fi
|
|
|
|
source_pkglist_file
|
|
msg "Installing dependencies ...\n"
|
|
if install_dependencies ;then
|
|
status_msg "Install dependencies ..." "0"
|
|
else
|
|
status_msg "Install dependencies ..." "1"
|
|
fi
|
|
|
|
import_config
|
|
|
|
msg "Creating file structure ..."
|
|
if create_filestructure ;then
|
|
status_msg "Creating file structure ..." "0"
|
|
else
|
|
status_msg "Creating file structure ..." "1"
|
|
fi
|
|
|
|
|
|
if link_main_executable; then
|
|
status_msg "Link crowsnest to /usr/local/bin ..." "0"
|
|
else
|
|
status_msg "Link crowsnest to /usr/local/bin ..." "1"
|
|
fi
|
|
|
|
if install_service_file; then
|
|
status_msg "Install service file ..." "0"
|
|
else
|
|
status_msg "Install service file ..." "1"
|
|
fi
|
|
|
|
if install_env_file; then
|
|
status_msg "Install environment file ..." "0"
|
|
else
|
|
status_msg "Install environment file ..." "1"
|
|
fi
|
|
|
|
if install_logrotate_conf; then
|
|
status_msg "Install logrotate configuration ..." "0"
|
|
else
|
|
status_msg "Install logrotate configuration ..." "1"
|
|
fi
|
|
|
|
if install_crowsnest_conf; then
|
|
status_msg "Install crowsnest.conf ..." "0"
|
|
else
|
|
status_msg "Install crowsnest.conf ..." "1"
|
|
fi
|
|
|
|
if enable_service; then
|
|
status_msg "Enable crowsnest.service ..." "0"
|
|
else
|
|
status_msg "Enable crowsnest.service ..." "1"
|
|
fi
|
|
|
|
add_group_video
|
|
|
|
build_apps
|
|
|
|
if [[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
|
|
set_gpu_mem
|
|
fi
|
|
|
|
if [[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
|
|
ask_update_entry
|
|
fi
|
|
|
|
if [[ "${CROWSNEST_UNATTENDED}" = "1" ]] &&
|
|
[[ "${CROWSNEST_ADD_CROWSNEST_MOONRAKER}" = "1" ]]; then
|
|
add_update_entry
|
|
fi
|
|
|
|
if [[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
|
|
goodbye_msg
|
|
ask_reboot
|
|
fi
|
|
|
|
if [[ "${CROWSNEST_UNATTENDED}" = "1" ]]; then
|
|
unattended_success_msg
|
|
fi
|
|
|
|
|
|
unset DEBIAN_FRONTEND
|
|
}
|
|
|
|
main "${@}"
|
|
exit 0
|