diff --git a/ansible/00_base.yaml b/ansible/00_base.yaml index 0ee69d0..fbf23b8 100644 --- a/ansible/00_base.yaml +++ b/ansible/00_base.yaml @@ -1,5 +1,4 @@ --- - - name: Install base system hosts: pisdr connection: chroot @@ -7,5 +6,6 @@ - include: tasks/mount.yaml roles: - base + - pisdr post_tasks: - include: tasks/umount.yaml \ No newline at end of file diff --git a/ansible/01_headless.yaml b/ansible/01_headless.yaml index 33a36dc..a569ce6 100644 --- a/ansible/01_headless.yaml +++ b/ansible/01_headless.yaml @@ -1,14 +1,18 @@ --- - - name: Install headless system hosts: pisdr connection: chroot pre_tasks: - include: tasks/mount.yaml + - include: tasks/update-apt.yaml roles: - uhd - gnuradio - soapysdr - limesdr + - airspy + - airspyhf + - rtlsdr + - plutosdr post_tasks: - - include: tasks/umount.yaml \ No newline at end of file + - include: tasks/umount.yaml diff --git a/ansible/02_desktop.yaml b/ansible/02_desktop.yaml index 4ea4f6a..7a79661 100644 --- a/ansible/02_desktop.yaml +++ b/ansible/02_desktop.yaml @@ -1,10 +1,10 @@ --- - - name: Install desktop system hosts: pisdr connection: chroot pre_tasks: - include: tasks/mount.yaml + - include: tasks/update-apt.yaml roles: - desktop post_tasks: diff --git a/ansible/03_grub.yaml b/ansible/03_grub.yaml index 1bff7a7..75864a6 100644 --- a/ansible/03_grub.yaml +++ b/ansible/03_grub.yaml @@ -1,10 +1,10 @@ --- - - name: Install GRUB patches hosts: pisdr connection: chroot pre_tasks: - include: tasks/mount.yaml + - include: tasks/update-apt.yaml roles: - grub post_tasks: diff --git a/ansible/03_tegra.yaml b/ansible/03_tegra.yaml index 6a180c0..0af6b00 100644 --- a/ansible/03_tegra.yaml +++ b/ansible/03_tegra.yaml @@ -1,19 +1,13 @@ --- - - name: Install Tegra patches hosts: pisdr connection: chroot pre_tasks: - - include: tasks/mount.yaml - tags: - - always + - {include: 'tasks/mount.yaml', tags: 'always'} + - {include: 'tasks/update-apt.yaml', tags: 'always'} roles: - {role: 'tegra_pre', tags: 'pre'} - {role: 'tegra_post', tags: 'post'} post_tasks: - - include: tasks/cleanup.yaml - tags: - - post - - include: tasks/umount.yaml - tags: - - always \ No newline at end of file + - {include: 'tasks/cleanup.yaml', tags: 'post'} + - {include: 'tasks/umount.yaml', tags: 'always'} \ No newline at end of file diff --git a/ansible/group_vars/all.yaml b/ansible/group_vars/all.yaml index 1ffe6cd..640c4f2 100644 --- a/ansible/group_vars/all.yaml +++ b/ansible/group_vars/all.yaml @@ -1,5 +1,4 @@ --- - user: shell: /bin/bash name: "{{ lookup('env', 'PISDR_USER') }}" diff --git a/ansible/roles/airspy/meta/main.yaml b/ansible/roles/airspy/meta/main.yaml new file mode 100644 index 0000000..a21fa75 --- /dev/null +++ b/ansible/roles/airspy/meta/main.yaml @@ -0,0 +1,5 @@ +--- +dependencies: + - role: pisdr + - role: gnuradio + - role: soapysdr diff --git a/ansible/roles/airspy/tasks/00_dep.yaml b/ansible/roles/airspy/tasks/00_dep.yaml new file mode 100644 index 0000000..e7388c9 --- /dev/null +++ b/ansible/roles/airspy/tasks/00_dep.yaml @@ -0,0 +1,10 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - libboost-all-dev + - libusb-1.0-0-dev + - ninja-build + - cmake + - build-essential \ No newline at end of file diff --git a/ansible/roles/airspy/tasks/01_base.yaml b/ansible/roles/airspy/tasks/01_base.yaml new file mode 100644 index 0000000..d29542f --- /dev/null +++ b/ansible/roles/airspy/tasks/01_base.yaml @@ -0,0 +1,24 @@ +--- +- name: Git checkout + git: + repo: https://github.com/airspy/airspyone_host.git + dest: "{{ install_dir }}/Airspy" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/Airspy + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DINSTALL_UDEV_RULES=ON ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs + +- name: Install UDEV Rules + shell: | + echo "/etc/udev/rules.d/52-airspy.rules" >> {{ config_dir }}/udev.paths \ No newline at end of file diff --git a/ansible/roles/airspy/tasks/02_soapy.yaml b/ansible/roles/airspy/tasks/02_soapy.yaml new file mode 100644 index 0000000..2d3ee5f --- /dev/null +++ b/ansible/roles/airspy/tasks/02_soapy.yaml @@ -0,0 +1,19 @@ +--- +- name: Git checkout + git: + repo: https://github.com/pothosware/SoapyAirspy.git + dest: "{{ install_dir }}/SoapyAirspy" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/SoapyAirspy + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/airspy/tasks/main.yaml b/ansible/roles/airspy/tasks/main.yaml new file mode 100644 index 0000000..daaefae --- /dev/null +++ b/ansible/roles/airspy/tasks/main.yaml @@ -0,0 +1,4 @@ +--- +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml +- include_tasks: 02_soapy.yaml \ No newline at end of file diff --git a/ansible/roles/airspyhf/meta/main.yaml b/ansible/roles/airspyhf/meta/main.yaml new file mode 100644 index 0000000..a21fa75 --- /dev/null +++ b/ansible/roles/airspyhf/meta/main.yaml @@ -0,0 +1,5 @@ +--- +dependencies: + - role: pisdr + - role: gnuradio + - role: soapysdr diff --git a/ansible/roles/airspyhf/tasks/00_dep.yaml b/ansible/roles/airspyhf/tasks/00_dep.yaml new file mode 100644 index 0000000..e7388c9 --- /dev/null +++ b/ansible/roles/airspyhf/tasks/00_dep.yaml @@ -0,0 +1,10 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - libboost-all-dev + - libusb-1.0-0-dev + - ninja-build + - cmake + - build-essential \ No newline at end of file diff --git a/ansible/roles/airspyhf/tasks/01_base.yaml b/ansible/roles/airspyhf/tasks/01_base.yaml new file mode 100644 index 0000000..aec2c74 --- /dev/null +++ b/ansible/roles/airspyhf/tasks/01_base.yaml @@ -0,0 +1,24 @@ +--- +- name: Git checkout + git: + repo: https://github.com/airspy/airspyhf.git + dest: "{{ install_dir }}/AirspyHF" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/AirspyHF + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DINSTALL_UDEV_RULES=ON ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs + +- name: Install UDEV Rules + shell: | + echo "/etc/udev/rules.d/52-airspyhf.rules" >> {{ config_dir }}/udev.paths \ No newline at end of file diff --git a/ansible/roles/airspyhf/tasks/02_soapy.yaml b/ansible/roles/airspyhf/tasks/02_soapy.yaml new file mode 100644 index 0000000..9abcc0f --- /dev/null +++ b/ansible/roles/airspyhf/tasks/02_soapy.yaml @@ -0,0 +1,19 @@ +--- +- name: Git checkout + git: + repo: https://github.com/pothosware/SoapyAirspyHF.git + dest: "{{ install_dir }}/SoapyAirspyHF" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/SoapyAirspyHF + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/airspyhf/tasks/main.yaml b/ansible/roles/airspyhf/tasks/main.yaml new file mode 100644 index 0000000..daaefae --- /dev/null +++ b/ansible/roles/airspyhf/tasks/main.yaml @@ -0,0 +1,4 @@ +--- +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml +- include_tasks: 02_soapy.yaml \ No newline at end of file diff --git a/ansible/roles/base/tasks/main.yaml b/ansible/roles/base/tasks/main.yaml index 193b7b5..2bc73b6 100644 --- a/ansible/roles/base/tasks/main.yaml +++ b/ansible/roles/base/tasks/main.yaml @@ -1,5 +1,4 @@ --- - - name: Update sources.list template: src: etc/apt/sources.list @@ -69,42 +68,5 @@ groups: sudo,sys,video,uucp,lp,input,audio,plugdev state: present -- name: Creates PiSDR directories - file: - path: "{{ item }}" - state: directory - loop: - - "{{ config_dir }}" - - "{{ install_dir }}" - -- name: Update build directories - template: - src: "etc/pisdr/{{ item }}" - dest: "{{ config_dir }}/{{ item }}" - owner: root - group: root - mode: 0764 - loop: - - "build.dirs" - - "udev.paths" - -- name: Update CMake optimization for ARM64 - template: - src: etc/pisdr/optimizations_arm64.cmake - dest: "{{ config_dir }}/optimizations.cmake" - owner: root - group: root - mode: 0644 - when: ansible_architecture == "aarch64" - -- name: Update CMake optimization for AMD64 - template: - src: etc/pisdr/optimizations_amd64.cmake - dest: "{{ config_dir }}/optimizations.cmake" - owner: root - group: root - mode: 0644 - when: ansible_architecture == "x86_64" - - name: Ensure default multi-user target shell: systemctl set-default multi-user.target \ No newline at end of file diff --git a/ansible/roles/desktop/tasks/main.yml b/ansible/roles/desktop/tasks/main.yml index 0c8a361..4b57b5e 100644 --- a/ansible/roles/desktop/tasks/main.yml +++ b/ansible/roles/desktop/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: Install ubuntu desktop minimal apt: name: ubuntu-desktop-minimal diff --git a/ansible/roles/gnuradio/meta/main.yaml b/ansible/roles/gnuradio/meta/main.yaml new file mode 100644 index 0000000..e2f7082 --- /dev/null +++ b/ansible/roles/gnuradio/meta/main.yaml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: pisdr diff --git a/ansible/roles/gnuradio/tasks/00_dep.yaml b/ansible/roles/gnuradio/tasks/00_dep.yaml new file mode 100644 index 0000000..e797c8f --- /dev/null +++ b/ansible/roles/gnuradio/tasks/00_dep.yaml @@ -0,0 +1,40 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - libboost-all-dev + - swig + - libzmq3-dev + - libfftw3-dev + - libgsl-dev + - libsdl1.2-dev + - libusb-1.0-0-dev + - libasound2-dev + - portaudio19-dev + - libportaudio2 + - pulseaudio + - libjack-dev + - libgmp-dev + - libsdl1.2-dev + - liblog4cpp5-dev + - libqwt-qt5-dev + - libqt5opengl5-dev + - python3-numpy + - python3-mako + - python3-sphinx + - python3-lxml + - python3-pyqt5 + - python3-yaml + - python3-click + - python3-click-plugins + - python3-zmq + - python3-scipy + - python3-pip + - python3-gi + - python3-gi-cairo + - gobject-introspection + - gir1.2-gtk-3.0 + - ninja-build + - cmake + - build-essential \ No newline at end of file diff --git a/ansible/roles/gnuradio/tasks/01_base.yaml b/ansible/roles/gnuradio/tasks/01_base.yaml new file mode 100644 index 0000000..2ddff90 --- /dev/null +++ b/ansible/roles/gnuradio/tasks/01_base.yaml @@ -0,0 +1,18 @@ +--- +- name: Git checkout + git: + repo: "https://github.com/gnuradio/gnuradio.git" + dest: "{{ install_dir }}/gnuradio" + version: maint-3.8 + recursive: yes + +- name: Build + shell: | + set -e + cd {{ install_dir }}/gnuradio + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/gnuradio/tasks/main.yaml b/ansible/roles/gnuradio/tasks/main.yaml index b36cafa..e7386f0 100644 --- a/ansible/roles/gnuradio/tasks/main.yaml +++ b/ansible/roles/gnuradio/tasks/main.yaml @@ -1,56 +1,3 @@ --- - -- name: Install Dependencies - apt: - name: "{{ item }}" - loop: - - libboost-all-dev - - swig - - libzmq3-dev - - libfftw3-dev - - libgsl-dev - - libsdl1.2-dev - - libusb-1.0-0-dev - - libasound2-dev - - portaudio19-dev - - libportaudio2 - - pulseaudio - - libjack-dev - - libgmp-dev - - libsdl1.2-dev - - liblog4cpp5-dev - - libqwt-qt5-dev - - libqt5opengl5-dev - - python3-numpy - - python3-mako - - python3-sphinx - - python3-lxml - - python3-pyqt5 - - python3-yaml - - python3-click - - python3-click-plugins - - python3-zmq - - python3-scipy - - python3-pip - - python3-gi - - python3-gi-cairo - - gobject-introspection - - gir1.2-gtk-3.0 - -- name: Git checkout - git: - repo: "https://github.com/gnuradio/gnuradio.git" - dest: "{{ install_dir }}/gnuradio" - version: maint-3.8 - recursive: yes - -- name: Build - shell: | - set -e - cd {{ install_dir }}/gnuradio - mkdir -p build - cd build - cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ - ninja install - ldconfig - echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml \ No newline at end of file diff --git a/ansible/roles/grub/tasks/main.yaml b/ansible/roles/grub/tasks/main.yaml index 3da0f40..17caed9 100644 --- a/ansible/roles/grub/tasks/main.yaml +++ b/ansible/roles/grub/tasks/main.yaml @@ -1,5 +1,4 @@ --- - - name: Install generic Linux kernel apt: name: linux-image-generic diff --git a/ansible/roles/limesdr/meta/main.yaml b/ansible/roles/limesdr/meta/main.yaml new file mode 100644 index 0000000..a21fa75 --- /dev/null +++ b/ansible/roles/limesdr/meta/main.yaml @@ -0,0 +1,5 @@ +--- +dependencies: + - role: pisdr + - role: gnuradio + - role: soapysdr diff --git a/ansible/roles/limesdr/tasks/00_dep.yaml b/ansible/roles/limesdr/tasks/00_dep.yaml new file mode 100644 index 0000000..f976eeb --- /dev/null +++ b/ansible/roles/limesdr/tasks/00_dep.yaml @@ -0,0 +1,14 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - swig + - libsqlite3-dev + - libi2c-dev + - libusb-1.0-0-dev + - libwxgtk3.0-gtk3-dev + - freeglut3-dev + - ninja-build + - cmake + - build-essential \ No newline at end of file diff --git a/ansible/roles/limesdr/tasks/01_base.yaml b/ansible/roles/limesdr/tasks/01_base.yaml new file mode 100644 index 0000000..18e4eae --- /dev/null +++ b/ansible/roles/limesdr/tasks/01_base.yaml @@ -0,0 +1,27 @@ +--- +- name: Git checkout + git: + repo: "https://github.com/myriadrf/LimeSuite.git" + dest: "{{ install_dir }}/LimeSuite" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/LimeSuite + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DCMAKE_CXX_FLAGS=-latomic ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs + +- name: Install UDEV Rules + shell: | + set -e + cd {{ install_dir }}/LimeSuite/udev-rules + ./install.sh + echo "/etc/udev/rules.d/64-limesuite.rules" >> {{ config_dir }}/udev.paths \ No newline at end of file diff --git a/ansible/roles/limesdr/tasks/02_gnuradio.yaml b/ansible/roles/limesdr/tasks/02_gnuradio.yaml new file mode 100644 index 0000000..c74293b --- /dev/null +++ b/ansible/roles/limesdr/tasks/02_gnuradio.yaml @@ -0,0 +1,20 @@ +--- +- name: Git checkout gr-limesdr + git: + repo: "https://github.com/myriadrf/gr-limesdr.git" + dest: "{{ install_dir }}/gr-limesdr" + version: gr-3.8 + recursive: yes + depth: 1 + +- name: Build gr-limesdr + shell: | + set -e + cd {{ install_dir }}/gr-limesdr + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DCMAKE_CXX_FLAGS=-latomic ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/limesdr/tasks/main.yaml b/ansible/roles/limesdr/tasks/main.yaml index 9fa1a4b..31147a8 100644 --- a/ansible/roles/limesdr/tasks/main.yaml +++ b/ansible/roles/limesdr/tasks/main.yaml @@ -1,57 +1,4 @@ --- - -- name: Install Dependencies - apt: - name: "{{ item }}" - loop: - - swig - - libsqlite3-dev - - libi2c-dev - - libusb-1.0-0-dev - - libwxgtk3.0-gtk3-dev - - freeglut3-dev - -- name: Git checkout - git: - repo: "https://github.com/myriadrf/LimeSuite.git" - dest: "{{ install_dir }}/LimeSuite" - version: master - recursive: yes - depth: 1 - -- name: Build - shell: | - set -e - cd {{ install_dir }}/LimeSuite - mkdir -p build - cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-latomic ../ - ninja install - ldconfig - echo "$(pwd)" >> {{ config_dir }}/build.dirs - -- name: Install UDEV Rules - shell: | - set -e - cd {{ install_dir }}/LimeSuite/udev-rules - ./install.sh - echo "/etc/udev/rules.d/64-limesuite.rules" >> {{ config_dir }}/udev.paths - -- name: Git checkout gr-limesdr - git: - repo: "https://github.com/myriadrf/gr-limesdr.git" - dest: "{{ install_dir }}/gr-limesdr" - version: gr-3.8 - recursive: yes - depth: 1 - -- name: Build gr-limesdr - shell: | - set -e - cd {{ install_dir }}/gr-limesdr - mkdir -p build - cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-latomic ../ - ninja install - ldconfig - echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml +- include_tasks: 02_gnuradio.yaml \ No newline at end of file diff --git a/ansible/roles/pisdr/tasks/main.yaml b/ansible/roles/pisdr/tasks/main.yaml new file mode 100644 index 0000000..12c8323 --- /dev/null +++ b/ansible/roles/pisdr/tasks/main.yaml @@ -0,0 +1,39 @@ +--- +- name: Creates PiSDR directories + file: + path: "{{ item }}" + state: directory + loop: + - "{{ config_dir }}" + - "{{ install_dir }}" + +- name: Update build directories + template: + src: "etc/pisdr/{{ item }}" + dest: "{{ config_dir }}/{{ item }}" + owner: root + group: root + mode: 0764 + loop: + - "build.dirs" + - "udev.paths" + +- name: Update CMake optimization for ARM64 + template: + src: etc/pisdr/optimizations_arm64.cmake + dest: "{{ config_dir }}/optimizations.cmake" + owner: root + group: root + mode: 0644 + force: no + when: ansible_architecture == "aarch64" + +- name: Update CMake optimization for AMD64 + template: + src: etc/pisdr/optimizations_amd64.cmake + dest: "{{ config_dir }}/optimizations.cmake" + owner: root + group: root + mode: 0644 + force: no + when: ansible_architecture == "x86_64" \ No newline at end of file diff --git a/ansible/roles/base/templates/etc/pisdr/build.dirs b/ansible/roles/pisdr/templates/etc/pisdr/build.dirs similarity index 100% rename from ansible/roles/base/templates/etc/pisdr/build.dirs rename to ansible/roles/pisdr/templates/etc/pisdr/build.dirs diff --git a/ansible/roles/base/templates/etc/pisdr/optimizations_amd64.cmake b/ansible/roles/pisdr/templates/etc/pisdr/optimizations_amd64.cmake similarity index 100% rename from ansible/roles/base/templates/etc/pisdr/optimizations_amd64.cmake rename to ansible/roles/pisdr/templates/etc/pisdr/optimizations_amd64.cmake diff --git a/ansible/roles/base/templates/etc/pisdr/optimizations_arm64.cmake b/ansible/roles/pisdr/templates/etc/pisdr/optimizations_arm64.cmake similarity index 100% rename from ansible/roles/base/templates/etc/pisdr/optimizations_arm64.cmake rename to ansible/roles/pisdr/templates/etc/pisdr/optimizations_arm64.cmake diff --git a/ansible/roles/base/templates/etc/pisdr/udev.paths b/ansible/roles/pisdr/templates/etc/pisdr/udev.paths similarity index 100% rename from ansible/roles/base/templates/etc/pisdr/udev.paths rename to ansible/roles/pisdr/templates/etc/pisdr/udev.paths diff --git a/ansible/roles/plutosdr/meta/main.yaml b/ansible/roles/plutosdr/meta/main.yaml new file mode 100644 index 0000000..a21fa75 --- /dev/null +++ b/ansible/roles/plutosdr/meta/main.yaml @@ -0,0 +1,5 @@ +--- +dependencies: + - role: pisdr + - role: gnuradio + - role: soapysdr diff --git a/ansible/roles/plutosdr/tasks/00_dep.yaml b/ansible/roles/plutosdr/tasks/00_dep.yaml new file mode 100644 index 0000000..23ed683 --- /dev/null +++ b/ansible/roles/plutosdr/tasks/00_dep.yaml @@ -0,0 +1,16 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - libusb-1.0-0-dev + - ninja-build + - cmake + - build-essential + - libxml2-dev + - bison + - flex + - libcdk5-dev + - libaio-dev + - libserialport-dev + - libavahi-client-dev \ No newline at end of file diff --git a/ansible/roles/plutosdr/tasks/01_base.yaml b/ansible/roles/plutosdr/tasks/01_base.yaml new file mode 100644 index 0000000..3f9fb29 --- /dev/null +++ b/ansible/roles/plutosdr/tasks/01_base.yaml @@ -0,0 +1,43 @@ +--- +- name: Git checkout libiio + git: + repo: https://github.com/analogdevicesinc/libiio + dest: "{{ install_dir }}/libiio" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/libiio + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DINSTALL_UDEV_RULES=ON ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs + +- name: Git checkout + git: + repo: https://github.com/analogdevicesinc/libad9361-iio + dest: "{{ install_dir }}/libad9361-iio" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/libad9361-iio + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs + +- name: Install UDEV Rules + shell: | + echo "/lib/udev/rules.d/90-libiio.rules" >> {{ config_dir }}/udev.paths \ No newline at end of file diff --git a/ansible/roles/plutosdr/tasks/02_soapy.yaml b/ansible/roles/plutosdr/tasks/02_soapy.yaml new file mode 100644 index 0000000..dca4728 --- /dev/null +++ b/ansible/roles/plutosdr/tasks/02_soapy.yaml @@ -0,0 +1,20 @@ +--- +- name: Git checkout + git: + repo: https://github.com/pothosware/SoapyPlutoSDR.git + dest: "{{ install_dir }}/SoapyPlutoSDR" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/SoapyPlutoSDR + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DCMAKE_CXX_FLAGS=-latomic ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/plutosdr/tasks/03_gnuradio.yaml b/ansible/roles/plutosdr/tasks/03_gnuradio.yaml new file mode 100644 index 0000000..d45543d --- /dev/null +++ b/ansible/roles/plutosdr/tasks/03_gnuradio.yaml @@ -0,0 +1,19 @@ +--- +- name: Git checkout + git: + repo: https://github.com/analogdevicesinc/gr-iio + dest: "{{ install_dir }}/gr-iio" + version: upgrade-3.8 + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/gr-iio + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/plutosdr/tasks/main.yaml b/ansible/roles/plutosdr/tasks/main.yaml new file mode 100644 index 0000000..0467321 --- /dev/null +++ b/ansible/roles/plutosdr/tasks/main.yaml @@ -0,0 +1,5 @@ +--- +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml +- include_tasks: 02_soapy.yaml +- include_tasks: 03_gnuradio.yaml \ No newline at end of file diff --git a/ansible/roles/rtlsdr/meta/main.yaml b/ansible/roles/rtlsdr/meta/main.yaml new file mode 100644 index 0000000..a21fa75 --- /dev/null +++ b/ansible/roles/rtlsdr/meta/main.yaml @@ -0,0 +1,5 @@ +--- +dependencies: + - role: pisdr + - role: gnuradio + - role: soapysdr diff --git a/ansible/roles/rtlsdr/tasks/00_dep.yaml b/ansible/roles/rtlsdr/tasks/00_dep.yaml new file mode 100644 index 0000000..e7388c9 --- /dev/null +++ b/ansible/roles/rtlsdr/tasks/00_dep.yaml @@ -0,0 +1,10 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - libboost-all-dev + - libusb-1.0-0-dev + - ninja-build + - cmake + - build-essential \ No newline at end of file diff --git a/ansible/roles/rtlsdr/tasks/01_base.yaml b/ansible/roles/rtlsdr/tasks/01_base.yaml new file mode 100644 index 0000000..7f529e2 --- /dev/null +++ b/ansible/roles/rtlsdr/tasks/01_base.yaml @@ -0,0 +1,24 @@ +--- +- name: Git checkout + git: + repo: https://github.com/osmocom/rtl-sdr + dest: "{{ install_dir }}/rtl-sdr" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/rtl-sdr + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs + +- name: Install UDEV Rules + shell: | + echo "/etc/udev/rules.d/rtl-sdr.rules" >> {{ config_dir }}/udev.paths \ No newline at end of file diff --git a/ansible/roles/rtlsdr/tasks/02_soapy.yaml b/ansible/roles/rtlsdr/tasks/02_soapy.yaml new file mode 100644 index 0000000..21187e5 --- /dev/null +++ b/ansible/roles/rtlsdr/tasks/02_soapy.yaml @@ -0,0 +1,20 @@ +--- +- name: Git checkout + git: + repo: https://github.com/pothosware/SoapyRTLSDR.git + dest: "{{ install_dir }}/SoapyRTLSDR" + version: master + recursive: yes + depth: 1 + +- name: Build + shell: | + set -e + cd {{ install_dir }}/SoapyRTLSDR + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake \ + -DCMAKE_CXX_FLAGS=-latomic ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/rtlsdr/tasks/main.yaml b/ansible/roles/rtlsdr/tasks/main.yaml new file mode 100644 index 0000000..daaefae --- /dev/null +++ b/ansible/roles/rtlsdr/tasks/main.yaml @@ -0,0 +1,4 @@ +--- +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml +- include_tasks: 02_soapy.yaml \ No newline at end of file diff --git a/ansible/roles/soapysdr/meta/main.yaml b/ansible/roles/soapysdr/meta/main.yaml new file mode 100644 index 0000000..c840f38 --- /dev/null +++ b/ansible/roles/soapysdr/meta/main.yaml @@ -0,0 +1,4 @@ +--- +dependencies: + - role: pisdr + - role: gnuradio \ No newline at end of file diff --git a/ansible/roles/soapysdr/tasks/00_dep.yaml b/ansible/roles/soapysdr/tasks/00_dep.yaml new file mode 100644 index 0000000..4837332 --- /dev/null +++ b/ansible/roles/soapysdr/tasks/00_dep.yaml @@ -0,0 +1,13 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - swig + - avahi-daemon + - libavahi-client-dev + - libusb-1.0-0-dev + - python3-dev + - ninja-build + - cmake + - build-essential \ No newline at end of file diff --git a/ansible/roles/soapysdr/tasks/01_base.yaml b/ansible/roles/soapysdr/tasks/01_base.yaml new file mode 100644 index 0000000..925822b --- /dev/null +++ b/ansible/roles/soapysdr/tasks/01_base.yaml @@ -0,0 +1,19 @@ +--- +- name: Git checkout SoapySDR + git: + repo: "https://github.com/pothosware/SoapySDR.git" + dest: "{{ install_dir }}/SoapySDR" + version: master + recursive: yes + depth: 1 + +- name: Build SoapySDR + shell: | + set -e + cd {{ install_dir }}/SoapySDR + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/soapysdr/tasks/02_remote.yaml b/ansible/roles/soapysdr/tasks/02_remote.yaml new file mode 100644 index 0000000..1aa9a21 --- /dev/null +++ b/ansible/roles/soapysdr/tasks/02_remote.yaml @@ -0,0 +1,19 @@ +--- +- name: Git checkout SoapySDR Remote + git: + repo: "https://github.com/pothosware/SoapyRemote.git" + dest: "{{ install_dir }}/SoapyRemote" + version: master + recursive: yes + depth: 1 + +- name: Build SoapySDR Remote + shell: | + set -e + cd {{ install_dir }}/SoapyRemote + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/soapysdr/tasks/03_gnuradio.yaml b/ansible/roles/soapysdr/tasks/03_gnuradio.yaml new file mode 100644 index 0000000..c066aa5 --- /dev/null +++ b/ansible/roles/soapysdr/tasks/03_gnuradio.yaml @@ -0,0 +1,19 @@ +--- +- name: Git checkout gr-soapy + git: + repo: "https://gitlab.com/librespacefoundation/gr-soapy.git" + dest: "{{ install_dir }}/gr-soapy" + version: master + recursive: yes + depth: 1 + +- name: Build gr-soapy + shell: | + set -e + cd {{ install_dir }}/gr-soapy + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file diff --git a/ansible/roles/soapysdr/tasks/main.yaml b/ansible/roles/soapysdr/tasks/main.yaml index 19de2bf..8ce1831 100644 --- a/ansible/roles/soapysdr/tasks/main.yaml +++ b/ansible/roles/soapysdr/tasks/main.yaml @@ -1,68 +1,5 @@ --- - -- name: Install Dependencies - apt: - name: "{{ item }}" - loop: - - swig - - avahi-daemon - - libavahi-client-dev - - libusb-1.0-0-dev - - python3-dev - -- name: Git checkout SoapySDR - git: - repo: "https://github.com/pothosware/SoapySDR.git" - dest: "{{ install_dir }}/SoapySDR" - version: master - recursive: yes - depth: 1 - -- name: Build SoapySDR - shell: | - set -e - cd {{ install_dir }}/SoapySDR - mkdir -p build - cd build - cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ - ninja install - ldconfig - echo "$(pwd)" >> {{ config_dir }}/build.dirs - -- name: Git checkout SoapySDR Remote - git: - repo: "https://github.com/pothosware/SoapyRemote.git" - dest: "{{ install_dir }}/SoapyRemote" - version: master - recursive: yes - depth: 1 - -- name: Build SoapySDR Remote - shell: | - set -e - cd {{ install_dir }}/SoapyRemote - mkdir -p build - cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../ - ninja install - ldconfig - echo "$(pwd)" >> {{ config_dir }}/build.dirs - -- name: Git checkout gr-soapy - git: - repo: "https://gitlab.com/librespacefoundation/gr-soapy.git" - dest: "{{ install_dir }}/gr-soapy" - version: master - recursive: yes - depth: 1 - -- name: Build gr-soapy - shell: | - set -e - cd {{ install_dir }}/gr-soapy - mkdir -p build - cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../ - ninja install - ldconfig - echo "$(pwd)" >> {{ config_dir }}/build.dirs \ No newline at end of file +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml +- include_tasks: 02_remote.yaml +- include_tasks: 03_gnuradio.yaml \ No newline at end of file diff --git a/ansible/roles/tegra_post/tasks/main.yaml b/ansible/roles/tegra_post/tasks/main.yaml index 8837665..8085ee2 100644 --- a/ansible/roles/tegra_post/tasks/main.yaml +++ b/ansible/roles/tegra_post/tasks/main.yaml @@ -1,5 +1,4 @@ --- - - name: Hold modules ignore_errors: yes shell: "apt-mark hold {{ item }}" diff --git a/ansible/roles/tegra_pre/tasks/main.yaml b/ansible/roles/tegra_pre/tasks/main.yaml index 7125d26..e5a2dfa 100644 --- a/ansible/roles/tegra_pre/tasks/main.yaml +++ b/ansible/roles/tegra_pre/tasks/main.yaml @@ -1,5 +1,4 @@ --- - - name: Install dependencies apt: name: "{{ item }}" diff --git a/ansible/roles/uhd/meta/main.yaml b/ansible/roles/uhd/meta/main.yaml new file mode 100644 index 0000000..dde5fcd --- /dev/null +++ b/ansible/roles/uhd/meta/main.yaml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: pisdr \ No newline at end of file diff --git a/ansible/roles/uhd/tasks/00_dep.yaml b/ansible/roles/uhd/tasks/00_dep.yaml new file mode 100644 index 0000000..91acfd7 --- /dev/null +++ b/ansible/roles/uhd/tasks/00_dep.yaml @@ -0,0 +1,11 @@ +--- +- name: Install Dependencies + apt: + name: "{{ item }}" + loop: + - libboost-all-dev + - libusb-1.0-0-dev + - python3-mako + - ninja-build + - cmake + - build-essential \ No newline at end of file diff --git a/ansible/roles/uhd/tasks/01_base.yaml b/ansible/roles/uhd/tasks/01_base.yaml new file mode 100644 index 0000000..abc015d --- /dev/null +++ b/ansible/roles/uhd/tasks/01_base.yaml @@ -0,0 +1,21 @@ +--- +- name: Git checkout + git: + repo: "https://github.com/EttusResearch/uhd.git" + dest: "{{ install_dir }}/uhd" + version: UHD-3.15.LTS + recursive: yes + +- name: Build + shell: | + set -e + cd {{ install_dir }}/uhd/host + mkdir -p build + cd build + cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ + ninja install + cp /usr/local/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/ + uhd_images_downloader + ldconfig + echo "$(pwd)" >> {{ config_dir }}/build.dirs + echo "/etc/udev/rules.d/uhd-usrp.rules" >> {{ config_dir }}/udev.paths \ No newline at end of file diff --git a/ansible/roles/uhd/tasks/main.yaml b/ansible/roles/uhd/tasks/main.yaml index 4e94e3a..e7386f0 100644 --- a/ansible/roles/uhd/tasks/main.yaml +++ b/ansible/roles/uhd/tasks/main.yaml @@ -1,30 +1,3 @@ --- - -- name: Install Dependencies - apt: - name: "{{ item }}" - loop: - - libboost-all-dev - - libusb-1.0-0-dev - - python3-mako - -- name: Git checkout - git: - repo: "https://github.com/EttusResearch/uhd.git" - dest: "{{ install_dir }}/uhd" - version: UHD-3.15.LTS - recursive: yes - -- name: Build - shell: | - set -e - cd {{ install_dir }}/uhd/host - mkdir -p build - cd build - cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/etc/pisdr/optimizations.cmake ../ - ninja install - cp /usr/local/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/ - uhd_images_downloader - ldconfig - echo "$(pwd)" >> {{ config_dir }}/build.dirs - echo "/etc/udev/rules.d/uhd-usrp.rules" >> {{ config_dir }}/udev.paths \ No newline at end of file +- include_tasks: 00_dep.yaml +- include_tasks: 01_base.yaml \ No newline at end of file diff --git a/ansible/standalone.yaml b/ansible/standalone.yaml new file mode 100644 index 0000000..8282646 --- /dev/null +++ b/ansible/standalone.yaml @@ -0,0 +1,14 @@ +--- +- name: Install Standalone Application + hosts: 127.0.0.1 + connection: local + vars: + PISDR_USER: luigi + pre_tasks: + - {include: 'tasks/mount.yaml', tags: 'always'} + - {include: 'tasks/update-apt.yaml', tags: 'always'} + roles: + - {role: 'uhd', tags: 'uhd'} + - {role: 'gnuradio', tags: 'gnuradio'} + - {role: 'soapysdr', tags: 'soapysdr'} + - {role: 'limesdr', tags: 'limesdr'} diff --git a/ansible/tasks/cleanup.yaml b/ansible/tasks/cleanup.yaml index 17569b5..093b44d 100644 --- a/ansible/tasks/cleanup.yaml +++ b/ansible/tasks/cleanup.yaml @@ -1,5 +1,4 @@ --- - - name: Clean apt cache command: apt clean become: yes diff --git a/ansible/tasks/mount.yaml b/ansible/tasks/mount.yaml index 34f94a3..630b0ca 100644 --- a/ansible/tasks/mount.yaml +++ b/ansible/tasks/mount.yaml @@ -1,5 +1,4 @@ --- - - name: Mount pseudo filesystems connection: local shell: mount -o bind '{{ item }}' '{{ lookup('env', 'ANSIBLE_ROOTFS_DIR') }}{{ item }}' diff --git a/ansible/tasks/umount.yaml b/ansible/tasks/umount.yaml index ed45f1f..c1f8557 100644 --- a/ansible/tasks/umount.yaml +++ b/ansible/tasks/umount.yaml @@ -1,5 +1,4 @@ --- - - name: Umount pseudo filesystems connection: local shell: umount -l '{{ lookup('env', 'ANSIBLE_ROOTFS_DIR') }}{{ item }}' diff --git a/ansible/tasks/update-apt.yaml b/ansible/tasks/update-apt.yaml new file mode 100644 index 0000000..a763eff --- /dev/null +++ b/ansible/tasks/update-apt.yaml @@ -0,0 +1,4 @@ +--- +- name: Update apt packages + apt: + update_cache: yes \ No newline at end of file diff --git a/build.sh b/build.sh index dc70ba7..aee88b0 100755 --- a/build.sh +++ b/build.sh @@ -42,13 +42,13 @@ printf "(OK)\n" ############################################################## #### Phase 00 -#( $TARGET/build_base.sh ) +( $TARGET/build_base.sh ) #### Phase 01 -#( $TARGET/build_headless.sh ) +( $TARGET/build_headless.sh ) #### Phase 02 -#( $TARGET/build_desktop.sh ) +( $TARGET/build_desktop.sh ) #### Phase 03 if [[ "$PISDR_ARCH" == "arm64" ]]; then