Files
emcomm-tools-os-community/scripts/install-sdr-tools.sh
T

60 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
#
# Author : Gaston Gonzalez
# Date : 4 June 2025
# Purpose : Install SDR tools
set -e
et-log "Installing SDR tools..."
2025-09-03 08:43:05 -04:00
. ./env.sh
APP=rtl-sdr
2025-09-04 08:58:20 -04:00
REPO=https://github.com/osmocom/rtl-sdr
2025-09-03 08:43:05 -04:00
REPO_SRC_DIR="${ET_SRC_DIR}/${APP}"
[[ ! -e ${ET_SRC_DIR} ]] && mkdir ${ET_SRC_DIR}
CWD_DIR=`pwd`
et-log "Installing ${APP} build dependencies..."
apt purge ^librtlsdr -y
rm -rvf /usr/lib/librtlsdr* /usr/include/rtl-sdr* /usr/local/lib/librtlsdr* /usr/local/include/rtl-sdr* /usr/local/include/rtl_* /usr/local/bin/rtl_*
apt-get install \
libusb-1.0-0-dev \
git \
cmake \
pkg-config \
2025-09-04 08:58:20 -04:00
debhelper \
2025-09-03 08:43:05 -04:00
-y
et-log "Cloning ${APP} repository..."
if [[ ! -e ${REPO_SRC_DIR} ]]; then
2025-09-04 08:58:20 -04:00
mkdir ${REPO_SRC_DIR}
cd ${REPO_SRC_DIR} && git clone ${REPO} src
2025-09-03 08:43:05 -04:00
fi
2025-09-04 08:58:20 -04:00
cd ${REPO_SRC_DIR}/src
2025-09-03 08:43:05 -04:00
et-log "Building ${APP}..."
2025-09-04 08:58:20 -04:00
if [[ ! -e build ]]; then
mkdir build
fi
2025-09-03 08:43:05 -04:00
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
make install
ldconfig
echo 'blacklist dvb_usb_rtl28xxu' | tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf
2025-09-04 08:58:20 -04:00
cd ..
dpkg-buildpackage -b --no-sign
cd ..
dpkg -i librtlsdr0_*
dpkg -i librtlsdr-dev_*
2025-09-03 08:43:05 -04:00
cd ${CWD_DIR}