From 11c606c43b46cd86616da2f889d7f97c8eb297eb Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Thu, 3 Mar 2022 19:15:55 +0100 Subject: New version --- install/README.md | 56 +++++++++++ install/odr-get | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++ install/odr-get.conf | 11 +++ 3 files changed, 324 insertions(+) create mode 100644 install/README.md create mode 100644 install/odr-get create mode 100644 install/odr-get.conf (limited to 'install') diff --git a/install/README.md b/install/README.md new file mode 100644 index 0000000..017267a --- /dev/null +++ b/install/README.md @@ -0,0 +1,56 @@ +# Table of contents +- [Introduction](#introduction) +- [Installation](#installation) +- [Removal](#removal) + +# Introduction +The goal of the odr-get shell script is to install: +- the [odr-mmbtools](https://www.opendigitalradio.org/mmbtools) components developed by the [Open Digital Radio](https://www.opendigitalradio.org/) non-profit association on a clean debian environment +- Working configuration files that you can later customize as you see fit + +# Installation +## Preliminary notes +We **highly recommend** that you install odr-mmbTools on a **new debian** environment, starting from the Bullseye release. Since some software components, like the audio encoders or the modulator, are CPU-intensive, we recommend you setup a lite debian environment (ie. without a GUI framework). + +If you want to quickly setup a lite clean debian environment, we suggest you use [Vagrant](https://www.vagrantup.com) associated with a virtualization hypervisor, like [Virtualbox](https://www.virtualbox.org). A sample Vagrantfile is available in the Vagrant folder of this repository. + +## Steps +1. Sign-in with your user profile +1. Update your system: + ``` + sudo apt-get update + sudo apt-get upgrade -y + ``` +1. Find your time zone: + ``` + timedatectl list-timezones + ``` +1. Set your time zone: + ``` + sudo timedatectl set-timezone your_timezone + ``` +1. Install the git command: + ``` + sudo apt-get install -y git + ``` +1. Clone this repository: + ``` + cd $HOME + git clone https://github.com/opendigitalradio/dab-scripts.git + ``` +1. Install the ODR-mmbTools suite and the sample configuration folder + ``` + # Install the stable version of odr-mmbTools + bash $HOME/dab-scripts/install/odr-get --branch master install + + # Or install the current version of odr-mmbTools + bash $HOME/dab-scripts/install/odr-get --branch next install + ``` + +# Removal +If you wish to remove the odr-mmbTools suite and the sample configuration folder, then follow these steps: +1. Stop all odr-mmbTools related jobs in supervisor +2. Remove the ODR-mmbTools software suite and the configuration folder + ``` + bash $HOME/dab-scripts/install/odr-get remove + ``` diff --git a/install/odr-get b/install/odr-get new file mode 100644 index 0000000..a49e7b0 --- /dev/null +++ b/install/odr-get @@ -0,0 +1,257 @@ +#!/bin/bash + +# odr-get - Build, install, uninstall, remove the software stack +# Copyright (C) 20222 Robin ALEXANDER +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +## CONSTANTS +source $(realpath $(dirname $0))/odr-get.conf + +print_usage () { + cat <<- EOF + Usage: + odr-get [option] action + + Option: + -h, --help Print this help + -b, --branch Specify the odr-mmbTools branch to use + + Action: + install Install the programs and the configuration sample + remove Remove the programs and the configuration sample + +EOF +} + +install_base () { + # Install the essential tools and create the tools root directory + sudo apt-get update + sudo apt-get install -y build-essential automake libtool supervisor + + if [ ! -d ${DIR_MMB} ]; then + mkdir ${DIR_MMB} + fi + + if [ ! $(grep inet_http_server /etc/supervisor/supervisord.conf) ]; then + cat << EOF | sudo tee -a /etc/supervisor/supervisord.conf > /dev/null + +[inet_http_server] +port = 8001 +username = odr ; Auth username +password = odr ; Auth password +EOF + fi +} + +install_audioenc () { + # Install mmb-tools: audio encoder + sudo apt-get install -y libzmq3-dev libzmq5 libvlc-dev vlc-data vlc-plugin-base libcurl4-openssl-dev pkg-config + if [ ! -d ${DIR_AUDIO} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-AudioEnc.git --branch ${1} + popd + fi + pushd ${DIR_AUDIO} + ./bootstrap + ./configure --enable-vlc + make + sudo make install + popd +} + +install_padenc () { + # Install mmb-tools: PAD encoder + sudo apt-get install -y libmagickwand-dev + if [ ! -d ${DIR_PAD} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-PadEnc.git --branch ${1} + popd + fi + pushd ${DIR_PAD} + ./bootstrap + ./configure + make + sudo make install + popd +} + +install_dabmux () { + # Install mmb-tools: dab multiplexer + sudo apt-get install -y libboost-system-dev libcurl4-openssl-dev python3-zmq + if [ ! -d ${DIR_MUX} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-DabMux.git --branch ${1} + popd + fi + pushd ${DIR_MUX} + ./bootstrap.sh + ## Temporary, until ODR-DabMux configure is modified + arch=$(uname -m) + if [ "${arch}" = "armv7l" ]; then + ./configure --with-boost-libdir=/usr/lib/arm-linux-gnueabihf + else + ./configure + fi + make + sudo make install + popd +} + +install_dabmod () { + # Install mmb-tools: modulator + sudo apt-get install -y libfftw3-dev libsoapysdr-dev + if [ ! -d ${DIR_MOD} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-DabMod.git --branch ${1} + popd + fi + pushd ${DIR_MOD} + ./bootstrap.sh + ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-output-uhd --disable-zeromq + make + sudo make install + popd +} + +install_fdkaac () { + # Install mmb-tools: fdk-aac + if [ ! -d ${DIR_FDKAAC} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/fdk-aac.git + popd + fi + pushd ${DIR_FDKAAC} + ./bootstrap + ./configure + make + sudo make install + popd +} + +install_srccmp () { + # Install mmb-tools: source companion + if [ ! -d ${DIR_SRCCMP} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-SourceCompanion.git --branch ${1} + popd + fi + pushd ${DIR_SRCCMP} + ./bootstrap + ./configure + make + sudo make install + popd +} + +install_encmgr () { + # Install mmb-tools: encoder manager + sudo apt-get install -y python3-cherrypy3 python3-jinja2 python3-serial python3-yaml supervisor python3-pysnmp4 + if [ ! -d ${DIR_ENCMGR} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-EncoderManager.git --branch ${1} + popd + fi + ## Add the current user to the dialout and audio groups + sudo usermod --append --group dialout $(id --user --name) + sudo usermod --append --group audio $(id --user --name) +} + +install_config () { +# Copy the configuration files + if [ -d ${DIR_CONFIG} ]; then + rm -r ${DIR_CONFIG} + fi + cp -r $(realpath $(dirname $0))/${CONFIG_NAME} ${DIR_CONFIG} + sudo ln -s ${DIR_CONFIG}/supervisor/*.conf /etc/supervisor/conf.d/ + + ## Adapt the supervisor configuration files + sed -e "s;user=pi;user=$(id --user --name);g" -i ${DIR_CONFIG}/supervisor/*.conf + sed -e "s;group=pi;group=$(id --group --name);g" -i ${DIR_CONFIG}/supervisor/*.conf + sed -e "s;/home/pi;${HOME};g" -i ${HOME}/config/supervisor/*.conf + + ## Adapt the ODR-EncoderManager configuration file + sed -e "s;/home/pi;${HOME};g" -i ${DIR_CONFIG}/encodermanager.json + sed -e "s;\"user\": \"pi\";\"user\": \"$(id --user --name)\";g" -i ${DIR_CONFIG}/encodermanager.json + sed -e "s;\"group\": \"pi\";\"group\": \"$(id --group --name)\";g" -i ${DIR_CONFIG}/encodermanager.json + + ## Adapt the odr-misc.conf + sed -e "s;--host=raspberrypi.local;--host=$(hostname -I | awk '{print $1}');" -i ${DIR_CONFIG}/supervisor/ODR-misc.conf + + ## Restart supervisor + sudo supervisorctl reread + sudo supervisorctl reload + + echo "Sample configuration files installed" +} + +install () { + # Clone the sources, build and install programs + install_base ${1} + install_fdkaac ${1} + install_audioenc ${1} + install_padenc ${1} + install_dabmux ${1} + install_dabmod ${1} + install_srccmp ${1} + install_encmgr ${1} + install_config + sudo ldconfig + + echo "ODR-mmbTools suite and configuration files installed" +} + +remove () { + # Uninstall programs + for makefile in $(ls ${DIR_MMB}/**/Makefile); do + pushd $(dirname ${makefile}) + sudo make uninstall + popd + done + + # Delete sources + rm -rf ${DIR_MMB} + + # Delete configuration files + rm -rf ${DIR_CONFIG} + + # Update supervisor + sudo rm /etc/supervisor/conf.d/ODR-* + sudo supervisorctl reread + sudo supervisorctl reload + + echo "ODR-mmbTools suite and configuration files removed" +} + +# MAIN PROGRAM +branch="master" +action="" + +while [ "$#" -gt 0 ] ; do + case "${1}" in + (-h|--help) print_usage; exit 0 ;; + (-b|--branch) branch="${2}" ; shift ;; + install) action="install" ;; + remove) action="remove" ;; + *) print_usage; exit 1 ;; + esac + shift +done + +if [ "${action}" == "install" ]; then + install ${branch} +else + remove +fi \ No newline at end of file diff --git a/install/odr-get.conf b/install/odr-get.conf new file mode 100644 index 0000000..e20380d --- /dev/null +++ b/install/odr-get.conf @@ -0,0 +1,11 @@ +# DEFINE DIRECTORIES +CONFIG_NAME=config +DIR_CONFIG=${HOME}/${CONFIG_NAME} +DIR_MMB=${HOME}/ODR-mmbTools +DIR_AUDIO=${DIR_MMB}/ODR-AudioEnc +DIR_PAD=${DIR_MMB}/ODR-PadEnc +DIR_MUX=${DIR_MMB}/ODR-DabMux +DIR_MOD=${DIR_MMB}/ODR-DabMod +DIR_FDKAAC=${DIR_MMB}/fdk-aac +DIR_SRCCMP=${DIR_MMB}/ODR-SourceCompanion +DIR_ENCMGR=${DIR_MMB}/ODR-EncoderManager \ No newline at end of file -- cgit v1.2.3 From 42ca93c303545c856f3ebf6bdf2c88b3bab9da58 Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Thu, 3 Mar 2022 19:55:17 +0100 Subject: Adapt to dab-scripts folder structure --- install/odr-get | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/odr-get b/install/odr-get index a49e7b0..09339b7 100644 --- a/install/odr-get +++ b/install/odr-get @@ -174,7 +174,7 @@ install_config () { if [ -d ${DIR_CONFIG} ]; then rm -r ${DIR_CONFIG} fi - cp -r $(realpath $(dirname $0))/${CONFIG_NAME} ${DIR_CONFIG} + cp -r $(realpath $(dirname $0))/../${CONFIG_NAME} ${DIR_CONFIG} sudo ln -s ${DIR_CONFIG}/supervisor/*.conf /etc/supervisor/conf.d/ ## Adapt the supervisor configuration files -- cgit v1.2.3 From 20b7ffda29951e48d15603436e2b21e1cfa51aec Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Thu, 3 Mar 2022 19:55:58 +0100 Subject: Text review --- install/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/README.md b/install/README.md index 017267a..ce94d45 100644 --- a/install/README.md +++ b/install/README.md @@ -43,7 +43,7 @@ If you want to quickly setup a lite clean debian environment, we suggest you use # Install the stable version of odr-mmbTools bash $HOME/dab-scripts/install/odr-get --branch master install - # Or install the current version of odr-mmbTools + # Or install the next version of odr-mmbTools bash $HOME/dab-scripts/install/odr-get --branch next install ``` -- cgit v1.2.3 From 766d65e569f17d68aa36dee9300d4a4e08b1f520 Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Thu, 3 Mar 2022 22:02:25 +0100 Subject: odr-dabmod: enables uhd output --- install/odr-get | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'install') diff --git a/install/odr-get b/install/odr-get index 09339b7..10ba058 100644 --- a/install/odr-get +++ b/install/odr-get @@ -112,7 +112,7 @@ install_dabmux () { install_dabmod () { # Install mmb-tools: modulator - sudo apt-get install -y libfftw3-dev libsoapysdr-dev + sudo apt-get install -y libfftw3-dev libsoapysdr-dev libuhd-dev if [ ! -d ${DIR_MOD} ]; then pushd ${DIR_MMB} git clone https://github.com/Opendigitalradio/ODR-DabMod.git --branch ${1} @@ -120,7 +120,7 @@ install_dabmod () { fi pushd ${DIR_MOD} ./bootstrap.sh - ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-output-uhd --disable-zeromq + ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-zeromq make sudo make install popd -- cgit v1.2.3 From 9b8f1e6d1cf08ff6fbecf0e9bf2947ede9316681 Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Fri, 4 Mar 2022 10:45:49 +0100 Subject: Add clean-up to installation step --- install/odr-get | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'install') diff --git a/install/odr-get b/install/odr-get index 10ba058..e6d7147 100644 --- a/install/odr-get +++ b/install/odr-get @@ -69,6 +69,7 @@ install_audioenc () { ./configure --enable-vlc make sudo make install + make clean popd } @@ -85,6 +86,7 @@ install_padenc () { ./configure make sudo make install + make clean popd } @@ -107,6 +109,7 @@ install_dabmux () { fi make sudo make install + make clean popd } @@ -123,6 +126,7 @@ install_dabmod () { ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-zeromq make sudo make install + make clean popd } @@ -138,6 +142,7 @@ install_fdkaac () { ./configure make sudo make install + make clean popd } @@ -153,6 +158,7 @@ install_srccmp () { ./configure make sudo make install + make clean popd } @@ -198,7 +204,7 @@ install_config () { } install () { - # Clone the sources, build and install programs + # Clone the sources, build and install programs, clean-up install_base ${1} install_fdkaac ${1} install_audioenc ${1} @@ -210,6 +216,9 @@ install () { install_config sudo ldconfig + sudo apt-get purge -y + sudo rm -rf /var/lib/apt/lists/* + echo "ODR-mmbTools suite and configuration files installed" } -- cgit v1.2.3 From 3082ca232799afb396346ed60188838dcbb5c216 Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Fri, 4 Mar 2022 10:53:24 +0100 Subject: Rename odr-get into mmbtools-get --- install/README.md | 8 +- install/mmbtools-get | 266 ++++++++++++++++++++++++++++++++++++++++++++++ install/mmbtools-get.conf | 11 ++ install/odr-get | 266 ---------------------------------------------- install/odr-get.conf | 11 -- 5 files changed, 281 insertions(+), 281 deletions(-) create mode 100644 install/mmbtools-get create mode 100644 install/mmbtools-get.conf delete mode 100644 install/odr-get delete mode 100644 install/odr-get.conf (limited to 'install') diff --git a/install/README.md b/install/README.md index ce94d45..0fbcb3c 100644 --- a/install/README.md +++ b/install/README.md @@ -4,7 +4,7 @@ - [Removal](#removal) # Introduction -The goal of the odr-get shell script is to install: +The goal of the mmbtools-get shell script is to install: - the [odr-mmbtools](https://www.opendigitalradio.org/mmbtools) components developed by the [Open Digital Radio](https://www.opendigitalradio.org/) non-profit association on a clean debian environment - Working configuration files that you can later customize as you see fit @@ -41,10 +41,10 @@ If you want to quickly setup a lite clean debian environment, we suggest you use 1. Install the ODR-mmbTools suite and the sample configuration folder ``` # Install the stable version of odr-mmbTools - bash $HOME/dab-scripts/install/odr-get --branch master install + bash $HOME/dab-scripts/install/mmbtools-get --branch master install # Or install the next version of odr-mmbTools - bash $HOME/dab-scripts/install/odr-get --branch next install + bash $HOME/dab-scripts/install/mmbtools-get --branch next install ``` # Removal @@ -52,5 +52,5 @@ If you wish to remove the odr-mmbTools suite and the sample configuration folder 1. Stop all odr-mmbTools related jobs in supervisor 2. Remove the ODR-mmbTools software suite and the configuration folder ``` - bash $HOME/dab-scripts/install/odr-get remove + bash $HOME/dab-scripts/install/mmbtools-get remove ``` diff --git a/install/mmbtools-get b/install/mmbtools-get new file mode 100644 index 0000000..ac50d08 --- /dev/null +++ b/install/mmbtools-get @@ -0,0 +1,266 @@ +#!/bin/bash + +# mmbtools-get - Build, install, uninstall, remove the software stack +# Copyright (C) 20222 Robin ALEXANDER +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +## CONSTANTS +source $(realpath $(dirname $0))/mmbtools-get.conf + +print_usage () { + cat <<- EOF + Usage: + mmbtools-get [option] action + + Option: + -h, --help Print this help + -b, --branch Specify the odr-mmbTools branch to use + + Action: + install Install the programs and the configuration sample + remove Remove the programs and the configuration sample + +EOF +} + +install_base () { + # Install the essential tools and create the tools root directory + sudo apt-get update + sudo apt-get install -y build-essential automake libtool supervisor + + if [ ! -d ${DIR_MMB} ]; then + mkdir ${DIR_MMB} + fi + + if [ ! $(grep inet_http_server /etc/supervisor/supervisord.conf) ]; then + cat << EOF | sudo tee -a /etc/supervisor/supervisord.conf > /dev/null + +[inet_http_server] +port = 8001 +username = odr ; Auth username +password = odr ; Auth password +EOF + fi +} + +install_audioenc () { + # Install mmb-tools: audio encoder + sudo apt-get install -y libzmq3-dev libzmq5 libvlc-dev vlc-data vlc-plugin-base libcurl4-openssl-dev pkg-config + if [ ! -d ${DIR_AUDIO} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-AudioEnc.git --branch ${1} + popd + fi + pushd ${DIR_AUDIO} + ./bootstrap + ./configure --enable-vlc + make + sudo make install + make clean + popd +} + +install_padenc () { + # Install mmb-tools: PAD encoder + sudo apt-get install -y libmagickwand-dev + if [ ! -d ${DIR_PAD} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-PadEnc.git --branch ${1} + popd + fi + pushd ${DIR_PAD} + ./bootstrap + ./configure + make + sudo make install + make clean + popd +} + +install_dabmux () { + # Install mmb-tools: dab multiplexer + sudo apt-get install -y libboost-system-dev libcurl4-openssl-dev python3-zmq + if [ ! -d ${DIR_MUX} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-DabMux.git --branch ${1} + popd + fi + pushd ${DIR_MUX} + ./bootstrap.sh + ## Temporary, until ODR-DabMux configure is modified + arch=$(uname -m) + if [ "${arch}" = "armv7l" ]; then + ./configure --with-boost-libdir=/usr/lib/arm-linux-gnueabihf + else + ./configure + fi + make + sudo make install + make clean + popd +} + +install_dabmod () { + # Install mmb-tools: modulator + sudo apt-get install -y libfftw3-dev libsoapysdr-dev libuhd-dev + if [ ! -d ${DIR_MOD} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-DabMod.git --branch ${1} + popd + fi + pushd ${DIR_MOD} + ./bootstrap.sh + ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-zeromq + make + sudo make install + make clean + popd +} + +install_fdkaac () { + # Install mmb-tools: fdk-aac + if [ ! -d ${DIR_FDKAAC} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/fdk-aac.git + popd + fi + pushd ${DIR_FDKAAC} + ./bootstrap + ./configure + make + sudo make install + make clean + popd +} + +install_srccmp () { + # Install mmb-tools: source companion + if [ ! -d ${DIR_SRCCMP} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-SourceCompanion.git --branch ${1} + popd + fi + pushd ${DIR_SRCCMP} + ./bootstrap + ./configure + make + sudo make install + make clean + popd +} + +install_encmgr () { + # Install mmb-tools: encoder manager + sudo apt-get install -y python3-cherrypy3 python3-jinja2 python3-serial python3-yaml supervisor python3-pysnmp4 + if [ ! -d ${DIR_ENCMGR} ]; then + pushd ${DIR_MMB} + git clone https://github.com/Opendigitalradio/ODR-EncoderManager.git --branch ${1} + popd + fi + ## Add the current user to the dialout and audio groups + sudo usermod --append --group dialout $(id --user --name) + sudo usermod --append --group audio $(id --user --name) +} + +install_config () { +# Copy the configuration files + if [ -d ${DIR_CONFIG} ]; then + rm -r ${DIR_CONFIG} + fi + cp -r $(realpath $(dirname $0))/../${CONFIG_NAME} ${DIR_CONFIG} + sudo ln -s ${DIR_CONFIG}/supervisor/*.conf /etc/supervisor/conf.d/ + + ## Adapt the supervisor configuration files + sed -e "s;user=pi;user=$(id --user --name);g" -i ${DIR_CONFIG}/supervisor/*.conf + sed -e "s;group=pi;group=$(id --group --name);g" -i ${DIR_CONFIG}/supervisor/*.conf + sed -e "s;/home/pi;${HOME};g" -i ${HOME}/config/supervisor/*.conf + + ## Adapt the ODR-EncoderManager configuration file + sed -e "s;/home/pi;${HOME};g" -i ${DIR_CONFIG}/encodermanager.json + sed -e "s;\"user\": \"pi\";\"user\": \"$(id --user --name)\";g" -i ${DIR_CONFIG}/encodermanager.json + sed -e "s;\"group\": \"pi\";\"group\": \"$(id --group --name)\";g" -i ${DIR_CONFIG}/encodermanager.json + + ## Adapt the odr-misc.conf + sed -e "s;--host=raspberrypi.local;--host=$(hostname -I | awk '{print $1}');" -i ${DIR_CONFIG}/supervisor/ODR-misc.conf + + ## Restart supervisor + sudo supervisorctl reread + sudo supervisorctl reload + + echo "Sample configuration files installed" +} + +install () { + # Clone the sources, build and install programs, clean-up + install_base ${1} + install_fdkaac ${1} + install_audioenc ${1} + install_padenc ${1} + install_dabmux ${1} + install_dabmod ${1} + install_srccmp ${1} + install_encmgr ${1} + install_config + sudo ldconfig + + sudo apt-get purge -y + sudo rm -rf /var/lib/apt/lists/* + + echo "ODR-mmbTools suite and configuration files installed" +} + +remove () { + # Uninstall programs + for makefile in $(ls ${DIR_MMB}/**/Makefile); do + pushd $(dirname ${makefile}) + sudo make uninstall + popd + done + + # Delete sources + rm -rf ${DIR_MMB} + + # Delete configuration files + rm -rf ${DIR_CONFIG} + + # Update supervisor + sudo rm /etc/supervisor/conf.d/ODR-* + sudo supervisorctl reread + sudo supervisorctl reload + + echo "ODR-mmbTools suite and configuration files removed" +} + +# MAIN PROGRAM +branch="master" +action="" + +while [ "$#" -gt 0 ] ; do + case "${1}" in + (-h|--help) print_usage; exit 0 ;; + (-b|--branch) branch="${2}" ; shift ;; + install) action="install" ;; + remove) action="remove" ;; + *) print_usage; exit 1 ;; + esac + shift +done + +if [ "${action}" == "install" ]; then + install ${branch} +else + remove +fi \ No newline at end of file diff --git a/install/mmbtools-get.conf b/install/mmbtools-get.conf new file mode 100644 index 0000000..e20380d --- /dev/null +++ b/install/mmbtools-get.conf @@ -0,0 +1,11 @@ +# DEFINE DIRECTORIES +CONFIG_NAME=config +DIR_CONFIG=${HOME}/${CONFIG_NAME} +DIR_MMB=${HOME}/ODR-mmbTools +DIR_AUDIO=${DIR_MMB}/ODR-AudioEnc +DIR_PAD=${DIR_MMB}/ODR-PadEnc +DIR_MUX=${DIR_MMB}/ODR-DabMux +DIR_MOD=${DIR_MMB}/ODR-DabMod +DIR_FDKAAC=${DIR_MMB}/fdk-aac +DIR_SRCCMP=${DIR_MMB}/ODR-SourceCompanion +DIR_ENCMGR=${DIR_MMB}/ODR-EncoderManager \ No newline at end of file diff --git a/install/odr-get b/install/odr-get deleted file mode 100644 index e6d7147..0000000 --- a/install/odr-get +++ /dev/null @@ -1,266 +0,0 @@ -#!/bin/bash - -# odr-get - Build, install, uninstall, remove the software stack -# Copyright (C) 20222 Robin ALEXANDER -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -## CONSTANTS -source $(realpath $(dirname $0))/odr-get.conf - -print_usage () { - cat <<- EOF - Usage: - odr-get [option] action - - Option: - -h, --help Print this help - -b, --branch Specify the odr-mmbTools branch to use - - Action: - install Install the programs and the configuration sample - remove Remove the programs and the configuration sample - -EOF -} - -install_base () { - # Install the essential tools and create the tools root directory - sudo apt-get update - sudo apt-get install -y build-essential automake libtool supervisor - - if [ ! -d ${DIR_MMB} ]; then - mkdir ${DIR_MMB} - fi - - if [ ! $(grep inet_http_server /etc/supervisor/supervisord.conf) ]; then - cat << EOF | sudo tee -a /etc/supervisor/supervisord.conf > /dev/null - -[inet_http_server] -port = 8001 -username = odr ; Auth username -password = odr ; Auth password -EOF - fi -} - -install_audioenc () { - # Install mmb-tools: audio encoder - sudo apt-get install -y libzmq3-dev libzmq5 libvlc-dev vlc-data vlc-plugin-base libcurl4-openssl-dev pkg-config - if [ ! -d ${DIR_AUDIO} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-AudioEnc.git --branch ${1} - popd - fi - pushd ${DIR_AUDIO} - ./bootstrap - ./configure --enable-vlc - make - sudo make install - make clean - popd -} - -install_padenc () { - # Install mmb-tools: PAD encoder - sudo apt-get install -y libmagickwand-dev - if [ ! -d ${DIR_PAD} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-PadEnc.git --branch ${1} - popd - fi - pushd ${DIR_PAD} - ./bootstrap - ./configure - make - sudo make install - make clean - popd -} - -install_dabmux () { - # Install mmb-tools: dab multiplexer - sudo apt-get install -y libboost-system-dev libcurl4-openssl-dev python3-zmq - if [ ! -d ${DIR_MUX} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-DabMux.git --branch ${1} - popd - fi - pushd ${DIR_MUX} - ./bootstrap.sh - ## Temporary, until ODR-DabMux configure is modified - arch=$(uname -m) - if [ "${arch}" = "armv7l" ]; then - ./configure --with-boost-libdir=/usr/lib/arm-linux-gnueabihf - else - ./configure - fi - make - sudo make install - make clean - popd -} - -install_dabmod () { - # Install mmb-tools: modulator - sudo apt-get install -y libfftw3-dev libsoapysdr-dev libuhd-dev - if [ ! -d ${DIR_MOD} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-DabMod.git --branch ${1} - popd - fi - pushd ${DIR_MOD} - ./bootstrap.sh - ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-zeromq - make - sudo make install - make clean - popd -} - -install_fdkaac () { - # Install mmb-tools: fdk-aac - if [ ! -d ${DIR_FDKAAC} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/fdk-aac.git - popd - fi - pushd ${DIR_FDKAAC} - ./bootstrap - ./configure - make - sudo make install - make clean - popd -} - -install_srccmp () { - # Install mmb-tools: source companion - if [ ! -d ${DIR_SRCCMP} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-SourceCompanion.git --branch ${1} - popd - fi - pushd ${DIR_SRCCMP} - ./bootstrap - ./configure - make - sudo make install - make clean - popd -} - -install_encmgr () { - # Install mmb-tools: encoder manager - sudo apt-get install -y python3-cherrypy3 python3-jinja2 python3-serial python3-yaml supervisor python3-pysnmp4 - if [ ! -d ${DIR_ENCMGR} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-EncoderManager.git --branch ${1} - popd - fi - ## Add the current user to the dialout and audio groups - sudo usermod --append --group dialout $(id --user --name) - sudo usermod --append --group audio $(id --user --name) -} - -install_config () { -# Copy the configuration files - if [ -d ${DIR_CONFIG} ]; then - rm -r ${DIR_CONFIG} - fi - cp -r $(realpath $(dirname $0))/../${CONFIG_NAME} ${DIR_CONFIG} - sudo ln -s ${DIR_CONFIG}/supervisor/*.conf /etc/supervisor/conf.d/ - - ## Adapt the supervisor configuration files - sed -e "s;user=pi;user=$(id --user --name);g" -i ${DIR_CONFIG}/supervisor/*.conf - sed -e "s;group=pi;group=$(id --group --name);g" -i ${DIR_CONFIG}/supervisor/*.conf - sed -e "s;/home/pi;${HOME};g" -i ${HOME}/config/supervisor/*.conf - - ## Adapt the ODR-EncoderManager configuration file - sed -e "s;/home/pi;${HOME};g" -i ${DIR_CONFIG}/encodermanager.json - sed -e "s;\"user\": \"pi\";\"user\": \"$(id --user --name)\";g" -i ${DIR_CONFIG}/encodermanager.json - sed -e "s;\"group\": \"pi\";\"group\": \"$(id --group --name)\";g" -i ${DIR_CONFIG}/encodermanager.json - - ## Adapt the odr-misc.conf - sed -e "s;--host=raspberrypi.local;--host=$(hostname -I | awk '{print $1}');" -i ${DIR_CONFIG}/supervisor/ODR-misc.conf - - ## Restart supervisor - sudo supervisorctl reread - sudo supervisorctl reload - - echo "Sample configuration files installed" -} - -install () { - # Clone the sources, build and install programs, clean-up - install_base ${1} - install_fdkaac ${1} - install_audioenc ${1} - install_padenc ${1} - install_dabmux ${1} - install_dabmod ${1} - install_srccmp ${1} - install_encmgr ${1} - install_config - sudo ldconfig - - sudo apt-get purge -y - sudo rm -rf /var/lib/apt/lists/* - - echo "ODR-mmbTools suite and configuration files installed" -} - -remove () { - # Uninstall programs - for makefile in $(ls ${DIR_MMB}/**/Makefile); do - pushd $(dirname ${makefile}) - sudo make uninstall - popd - done - - # Delete sources - rm -rf ${DIR_MMB} - - # Delete configuration files - rm -rf ${DIR_CONFIG} - - # Update supervisor - sudo rm /etc/supervisor/conf.d/ODR-* - sudo supervisorctl reread - sudo supervisorctl reload - - echo "ODR-mmbTools suite and configuration files removed" -} - -# MAIN PROGRAM -branch="master" -action="" - -while [ "$#" -gt 0 ] ; do - case "${1}" in - (-h|--help) print_usage; exit 0 ;; - (-b|--branch) branch="${2}" ; shift ;; - install) action="install" ;; - remove) action="remove" ;; - *) print_usage; exit 1 ;; - esac - shift -done - -if [ "${action}" == "install" ]; then - install ${branch} -else - remove -fi \ No newline at end of file diff --git a/install/odr-get.conf b/install/odr-get.conf deleted file mode 100644 index e20380d..0000000 --- a/install/odr-get.conf +++ /dev/null @@ -1,11 +0,0 @@ -# DEFINE DIRECTORIES -CONFIG_NAME=config -DIR_CONFIG=${HOME}/${CONFIG_NAME} -DIR_MMB=${HOME}/ODR-mmbTools -DIR_AUDIO=${DIR_MMB}/ODR-AudioEnc -DIR_PAD=${DIR_MMB}/ODR-PadEnc -DIR_MUX=${DIR_MMB}/ODR-DabMux -DIR_MOD=${DIR_MMB}/ODR-DabMod -DIR_FDKAAC=${DIR_MMB}/fdk-aac -DIR_SRCCMP=${DIR_MMB}/ODR-SourceCompanion -DIR_ENCMGR=${DIR_MMB}/ODR-EncoderManager \ No newline at end of file -- cgit v1.2.3 From 4c286456bc0e63afe8ab8ebb3b657990e2eaa6f4 Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Fri, 4 Mar 2022 11:10:03 +0100 Subject: Text review --- install/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'install') diff --git a/install/README.md b/install/README.md index 0fbcb3c..e41746c 100644 --- a/install/README.md +++ b/install/README.md @@ -36,8 +36,13 @@ If you want to quickly setup a lite clean debian environment, we suggest you use 1. Clone this repository: ``` cd $HOME + + # Clone the stable version of dab-scripts git clone https://github.com/opendigitalradio/dab-scripts.git - ``` + + # Or clone the next version of dab-scripts + git clone --branch next https://github.com/opendigitalradio/dab-scripts.git +``` 1. Install the ODR-mmbTools suite and the sample configuration folder ``` # Install the stable version of odr-mmbTools -- cgit v1.2.3 From 4312fd554743be750e8023214c56eee7149749d2 Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Fri, 4 Mar 2022 11:11:38 +0100 Subject: Correction --- install/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/README.md b/install/README.md index e41746c..83e74a0 100644 --- a/install/README.md +++ b/install/README.md @@ -42,7 +42,7 @@ If you want to quickly setup a lite clean debian environment, we suggest you use # Or clone the next version of dab-scripts git clone --branch next https://github.com/opendigitalradio/dab-scripts.git -``` + ``` 1. Install the ODR-mmbTools suite and the sample configuration folder ``` # Install the stable version of odr-mmbTools -- cgit v1.2.3 From 63fee7f70c8cf1fd05e3b9d2d4bed4d3dfd148bb Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Sat, 12 Mar 2022 11:38:23 +0100 Subject: Add limesdr and bladerf features --- install/mmbtools-get | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'install') diff --git a/install/mmbtools-get b/install/mmbtools-get index ac50d08..2dab049 100644 --- a/install/mmbtools-get +++ b/install/mmbtools-get @@ -115,7 +115,7 @@ install_dabmux () { install_dabmod () { # Install mmb-tools: modulator - sudo apt-get install -y libfftw3-dev libsoapysdr-dev libuhd-dev + sudo apt-get install -y libfftw3-dev libzmq3-dev libuhd-dev libsoapysdr-dev libbladerf-dev liblimesuite-dev if [ ! -d ${DIR_MOD} ]; then pushd ${DIR_MMB} git clone https://github.com/Opendigitalradio/ODR-DabMod.git --branch ${1} @@ -123,7 +123,7 @@ install_dabmod () { fi pushd ${DIR_MOD} ./bootstrap.sh - ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-zeromq + ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-zeromq --enable-limesdr --enable-bladerf make sudo make install make clean -- cgit v1.2.3