diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75cd460..07ee36f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,17 +3,27 @@ on: workflow_dispatch jobs: release_job: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 name: Build Release steps: - uses: actions/checkout@v2 - name: Build - # note: crossbuild-essential-armhf on 18.04 is GCC-7.2, on 20.04 GCC-9.2 - # GCC-7.2 has GLIBC trouble on SoapyRemote avahi linking - # GCC-9.2 has stropts.h trouble with socat + # crossbuild-essential-armhf on 22.04 is GCC-11.2 (also has 10.5, 9.5) + # on 20.04 GCC-9.2 (also has 8), on 18.04 is GCC-7.2 + # crossbuild-essential-armhf on Bookworm is GCC-12.2 (also has 11.3) + # on Bullseye GCC-10.3 (also has 9), on Buster is GCC-8.3 + # note: GCC-9+ currently do not work with (GCC 7.3 built) sysroot 0.38. + # Note the GLIBC (libc6-dev-armhf-cross) version mismatch: + # buster has 2.28, bullseye has 2.31, bookworm has 2.36 + # focal (20.04) has 2.31, jammy (22.04) has 2.35 + # note: GCC-7.2 has GLIBC trouble on SoapyRemote avahi linking + # run: | + # sudo apt-get install -y git rsync gcc-8-arm-linux-gnueabihf g++-8-arm-linux-gnueabihf cmake scons autoconf bison yodl python3-distutils + # sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-8 100 --slave /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-8 run: | - sudo apt-get install -y git rsync gcc-8-arm-linux-gnueabihf g++-8-arm-linux-gnueabihf cmake scons autoconf bison yodl - sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-8 100 --slave /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-8 + sudo apt-get install -y git rsync cmake scons autoconf bison yodl python3-distutils + wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz + tar xf gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz ./build.sh - name: Get Release tag run: echo "RELEASE_VERSION=$(date +%F)" >> $GITHUB_ENV diff --git a/README.md b/README.md index 594df20..1c62ae3 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,15 @@ Let me know what other tools would be useful. Download [a Release](https://github.com/triq-org/PlutoSDR-Apps/releases), then copy to the Pluto and unpack to `/usr` +``` +$ wget https://github.com/triq-org/PlutoSDR-Apps/releases/download/2024-02-23/plutosdr-apps-2024-02-23.tar.gz +$ gzip -dc plutosdr-apps-2024-02-23.tar.gz |ssh root@pluto "cd /usr ; tar xv" +$ ssh root@pluto +# SoapySDRUtil --args="driver=plutosdr" --rate=50000000 --direction=RX +# SoapySDRServer --bind +$ SoapySDRUtil --args="driver=remote,remote=192.168.2.1,remote:driver=plutosdr" --rate=4000000 --direction=RX +``` + ## Notes on the compiler toolchain If you want to compile yourself you need a compiler toolchain. @@ -37,11 +46,21 @@ Toolchain path will be `/usr` and is already setup. You can use the ARM.com (previously Linaro) supplied compiler. -See [GNU Toolchain for the A-profile Architecture](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/8-2-2019-01). -You want the download "AArch32 target with hard float (arm-linux-gnueabihf)", then just unpack. +See [GNU Toolchain for the A-profile Architecture](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads). +The `8.2-2019.01` version could work. You want the download "AArch32 target with hard float (arm-linux-gnueabihf)", then just unpack. Toolchain path will be `DESTDIR/gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf` +## Using GNU Toolchain releases from Linaro + +Newer versions of the Pluto firmware don't use GCC 8.2.0 anymore but GCC 7.3 now. + +See [Arm GNU Toolchain Downloads](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) +for [GNU Toolchain releases from Linaro (discontinued)](https://releases.linaro.org/components/toolchain/binaries/). +The `7.3-2018.05` version should work. You want the download "arm-linux-gnueabihf", then just unpack. + +Toolchain path will be `DESTDIR/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf` + ### Using Xilinx 2019.1 SDK toolchain You can use the Xilinix provided compiler. diff --git a/build.sh b/build.sh index 01a1caa..5ce75aa 100755 --- a/build.sh +++ b/build.sh @@ -2,6 +2,8 @@ set -e +FIRMWARE=${FIRMWARE:=0.38} + export builddir="${builddir:-$(pwd)}" date +%F >"${builddir}/RELEASE-VERSION.txt" @@ -21,6 +23,12 @@ if [ -z "${tools}" -a -d "gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf" ] ; th echo '- Compiler: gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf' >>"${releaseinfo}" fi +if [ -z "${tools}" -a -d "gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf" ] ; then + export tools="${builddir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf" + export PATH="${tools}/bin:$PATH" + echo '- Compiler: gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf' >>"${releaseinfo}" +fi + if [ -z "${tools}" -a -d "/opt/Xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi" ] ; then export tools="/opt/Xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi" export PATH="${tools}/bin:$PATH" @@ -33,70 +41,83 @@ if [ -z "${tools}" ] ; then echo 'Or a standalone toolchain:' echo '$ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2019.01/gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf.tar.xz' echo '$ tar xf gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf.tar.xz' + echo 'Or for newer firmware versions:' + echo '$ wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz' + echo '$ tar xf gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz' exit 1 fi # Setup Sysroot if [ ! -d staging ] ; then - [ -f sysroot-v0.34.tar.gz ] || wget https://github.com/analogdevicesinc/plutosdr-fw/releases/download/v0.34/sysroot-v0.34.tar.gz - tar xzf sysroot-v0.34.tar.gz + [ -f sysroot-v${FIRMWARE}.tar.gz ] || wget https://github.com/analogdevicesinc/plutosdr-fw/releases/download/v${FIRMWARE}/sysroot-v${FIRMWARE}.tar.gz + tar xzf sysroot-v${FIRMWARE}.tar.gz fi -echo '- plutosdr-fw: sysroot v0.34' >>"${releaseinfo}" +echo "- plutosdr-fw: sysroot v${FIRMWARE}" >>"${releaseinfo}" export sysroot="${sysroot:-${builddir}/staging}" export stagedir="${stagedir:-${builddir}/stage}" export toolchain="${toolchain:-${builddir}/Toolchain-arm-linux-gnueabi.cmake}" # Compile Apps -[ -d SoapySDR ] || git clone https://github.com/pothosware/SoapySDR.git +#export CFLAGS="-Werror" +#export CXXFLAGS="-Werror -Wno-psabi" + +[ -d SoapySDR ] || git clone --depth 1 https://github.com/pothosware/SoapySDR.git pushd SoapySDR echo -n '- SoapySDR: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" -rm -rf build ; mkdir build ; pushd build -cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PYTHON=OFF -DENABLE_PYTHON3=OFF .. && make && make install -popd ; popd +rm -rf build ; mkdir build +cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PYTHON=OFF -DENABLE_PYTHON3=OFF -B build +cmake --build build -- install +popd -[ -d SoapyPlutoSDR ] || git clone https://github.com/pothosware/SoapyPlutoSDR.git +[ -d SoapyPlutoSDR ] || git clone --depth 1 https://github.com/pothosware/SoapyPlutoSDR.git pushd SoapyPlutoSDR echo -n '- SoapyPlutoSDR: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" -rm -rf build ; mkdir build ; pushd build -cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" .. && make && make install -popd ; popd +rm -rf build ; mkdir build +cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" -B build +cmake --build build -- install +popd -[ -d SoapyRemote ] || git clone https://github.com/pothosware/SoapyRemote.git +[ -d SoapyRemote ] || git clone --depth 1 https://github.com/pothosware/SoapyRemote.git pushd SoapyRemote echo -n '- SoapyRemote: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" -rm -rf build ; mkdir build ; pushd build -cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" .. && make && make install -popd ; popd +rm -rf build ; mkdir build +cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" -B build +cmake --build build -- install +popd -[ -d rtl_433 ] || git clone https://github.com/merbanan/rtl_433.git +[ -d rtl_433 ] || git clone --depth 1 https://github.com/merbanan/rtl_433.git pushd rtl_433 echo -n '- rtl_433: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" -rm -rf build ; mkdir build ; pushd build -cmake -DENABLE_RTLSDR=OFF -DENABLE_SOAPYSDR=ON -DENABLE_OPENSSL=OFF -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" .. && make && make install -popd ; popd +rm -rf build ; mkdir build +cmake -DENABLE_RTLSDR=OFF -DENABLE_SOAPYSDR=ON -DENABLE_OPENSSL=OFF -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" -B build +cmake --build build -- install +popd -[ -d rx_tools ] || git clone https://github.com/rxseger/rx_tools.git +[ -d rx_tools ] || git clone --depth 1 https://github.com/rxseger/rx_tools.git pushd rx_tools echo -n '- rx_tools: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" -rm -rf build ; mkdir build ; pushd build -cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" .. && make && make install -popd ; popd +rm -rf build ; mkdir build +cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" -B build +cmake --build build -- install +popd -[ -d tx_tools ] || git clone https://github.com/triq-org/tx_tools.git +[ -d tx_tools ] || git clone --depth 1 https://github.com/triq-org/tx_tools.git pushd tx_tools echo -n '- tx_tools: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" -rm -rf build ; mkdir build ; pushd build -cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" .. && make && make install -popd ; popd +rm -rf build ; mkdir build +cmake -DCMAKE_TOOLCHAIN_FILE="${toolchain}" -DCMAKE_INSTALL_PREFIX=/usr -DSoapySDR_DIR="${stagedir}/share/cmake/SoapySDR" -B build +cmake --build build -- install +popd +# Note: dumb http transport does not support shallow capabilities [ -d chrony ] || git clone https://git.tuxfamily.org/chrony/chrony.git pushd chrony echo -n '- chrony: ' >>"${releaseinfo}" @@ -108,7 +129,7 @@ make cp -a chronyc chronyd "${stagedir}/bin/" popd -[ -d gpsd ] || git clone git://git.savannah.gnu.org/gpsd.git +[ -d gpsd ] || git clone --depth 1 git://git.savannah.gnu.org/gpsd.git pushd gpsd echo -n '- gpsd: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" @@ -116,7 +137,7 @@ git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${relea DESTDIR="${stagedir}" scons libgpsmm=No ncurses=No python=No sbindir=bin prefix=/ sysroot="${sysroot}" target=arm-linux-gnueabihf build install popd -[ -d iperf ] || git clone https://github.com/esnet/iperf.git +[ -d iperf ] || git clone --depth 1 https://github.com/esnet/iperf.git pushd iperf echo -n '- iperf: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}" @@ -125,7 +146,7 @@ make make install DESTDIR=${stagedir} prefix=/ popd -[ -d socat ] || git clone git://repo.or.cz/socat.git +[ -d socat ] || git clone --depth 1 git://repo.or.cz/socat.git pushd socat echo -n '- socat: ' >>"${releaseinfo}" git describe --tags --first-parent --abbrev=7 --long --dirty --always >>"${releaseinfo}"