diff --git a/README.md b/README.md index b1185dd4f..724a0db40 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,20 @@ Anthias is a digital signage platform for Raspberry Pi. Formerly known as Screenly OSE, it was rebranded to clear up the confusion between Screenly (the paid version) and Anthias. More details can be found in [this blog post](https://www.screenly.io/blog/2022/12/06/screenly-ose-now-called-anthias/). -Anthias works on all Raspberry Pi versions, including Raspberry Pi Zero, Raspberry Pi 3 Model B, and Raspberry Pi 4 Model B. - Want to help Anthias thrive? Support us using [GitHub Sponsor](https://github.com/sponsors/Screenly). +## Compatibility + +We've tested Anthias and is known to work on the following Raspberry Pi models: + +* Raspberry Pi 4 Model B - 32-bt and 64-bit Bullseye, 64-bit Bookworm +* Raspberry Pi 3 Model B+ - 32-bit and 64-bit Bullseye, 64-bit Bookworm +* Raspberry Pi 3 Model B - 64-bit Bookworm + +We're still fixing the installer so that it'll work with Raspberry Pi Zero and Raspberry Pi 2. +Should you encounter any issues, please file an issue either in this repository or in the +[forums](https://forums.screenly.io). + ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=Screenly/Anthias&type=Date)](https://star-history.com/#Screenly/Anthias&Date) diff --git a/ansible/roles/network/tasks/main.yml b/ansible/roles/network/tasks/main.yml index 1e2988d00..14d487a3d 100644 --- a/ansible/roles/network/tasks/main.yml +++ b/ansible/roles/network/tasks/main.yml @@ -12,7 +12,7 @@ ansible.builtin.template: src: "{{ item }}" dest: "/etc/systemd/system/{{ item }}" - mode: 0644 + mode: "0644" owner: root group: root with_items: "{{ network_systemd_units }}" @@ -78,9 +78,15 @@ dest: /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla when: manage_network|bool +- name: Get stat of org.freedesktop.NetworkManager.pkla + ansible.builtin.stat: + path: /etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla + register: nm_pkla_path + - name: Copy org.freedesktop.NetworkManager.pkla to 50-local.d ansible.builtin.command: cp -f /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla /etc/polkit-1/localauthority/50-local.d when: manage_network|bool + changed_when: not nm_pkla_path.stat.exists - name: Disable dhcpcd ansible.builtin.systemd: @@ -89,6 +95,7 @@ enabled: false when: - ansible_distribution_major_version|int >= 9 + - ansible_distribution_major_version|int <= 11 - manage_network|bool - name: Activate NetworkManager diff --git a/ansible/roles/screenly/tasks/main.yml b/ansible/roles/screenly/tasks/main.yml index 6124eb3cc..3f8991187 100644 --- a/ansible/roles/screenly/tasks/main.yml +++ b/ansible/roles/screenly/tasks/main.yml @@ -5,7 +5,7 @@ state: directory owner: "{{ lookup('env', 'USER') }}" group: "{{ lookup('env', 'USER') }}" - mode: 0755 + mode: "0755" with_items: - .screenly - .config @@ -15,7 +15,7 @@ ansible.builtin.copy: owner: "{{ lookup('env', 'USER') }}" group: "{{ lookup('env', 'USER') }}" - mode: 0644 + mode: "0644" src: default_assets.yml dest: "/home/{{ lookup('env', 'USER') }}/.screenly/default_assets.yml" force: true @@ -30,6 +30,14 @@ ansible.builtin.pip: requirements: "/home/{{ lookup('env', 'USER') }}/screenly/requirements/requirements.host.txt" extra_args: "--no-cache-dir --upgrade" + when: ansible_distribution_major_version|int <= 11 + +- name: Install pip dependencies + ansible.builtin.pip: + executable: "/home/{{ lookup('env', 'USER') }}/installer_venv/bin/pip" + requirements: "/home/{{ lookup('env', 'USER') }}/screenly/requirements/requirements.host.txt" + extra_args: "--no-cache-dir --upgrade" + when: ansible_distribution_major_version|int >= 12 - name: Remove screenly_utils.sh ansible.builtin.file: @@ -46,7 +54,7 @@ ansible.builtin.get_url: url: https://raw.githubusercontent.com/Screenly/screenly-ose/master/bin/install.sh dest: /usr/local/sbin/upgrade_screenly.sh - mode: 0700 + mode: "0700" owner: root group: root force: true @@ -55,7 +63,7 @@ ansible.builtin.copy: src: screenly_overrides dest: /etc/sudoers.d/screenly_overrides - mode: 0440 + mode: "0440" owner: root group: root @@ -63,7 +71,7 @@ ansible.builtin.copy: src: screenly_usb_assets.sh dest: /usr/local/bin/screenly_usb_assets.sh - mode: 0755 + mode: "0755" owner: root group: root @@ -71,7 +79,7 @@ ansible.builtin.copy: src: 50-autoplay.rules dest: /etc/udev/rules.d/50-autoplay.rules - mode: 0644 + mode: "0644" owner: root group: root @@ -79,7 +87,7 @@ ansible.builtin.copy: src: /lib/systemd/system/systemd-udevd.service dest: /etc/systemd/system/systemd-udevd.service - mode: 0644 + mode: "0644" owner: root group: root @@ -93,7 +101,7 @@ ansible.builtin.template: src: "{{ item }}" dest: "/etc/systemd/system/{{ item }}" - mode: 0644 + mode: "0644" owner: root group: root with_items: "{{ screenly_systemd_units }}" diff --git a/ansible/roles/splashscreen/tasks/main.yml b/ansible/roles/splashscreen/tasks/main.yml index 95e6fb39f..cd4658366 100644 --- a/ansible/roles/splashscreen/tasks/main.yml +++ b/ansible/roles/splashscreen/tasks/main.yml @@ -10,7 +10,7 @@ ansible.builtin.copy: src: splashscreen.png dest: /etc/splashscreen.png - mode: 0644 + mode: "0644" owner: root group: root when: ansible_distribution_major_version|int <= 7 @@ -19,7 +19,7 @@ ansible.builtin.copy: src: asplashscreen dest: /etc/init.d/asplashscreen - mode: 0755 + mode: "0755" when: ansible_distribution_major_version|int <= 7 - name: Enables asplashscreen @@ -38,20 +38,30 @@ - /etc/init.d/asplashscreen when: ansible_distribution_major_version|int > 7 +- name: Get stat of asplashscreen + ansible.builtin.stat: + path: /etc/rcS.d/S01asplashscreen + register: asplashscreen_path + when: ansible_distribution_major_version|int > 7 + - name: Disable asplashscreen ansible.builtin.command: update-rc.d asplashscreen remove when: ansible_distribution_major_version|int > 7 + changed_when: asplashscreen_path.stat.exists - name: Installs dependencies (not Jessie) ansible.builtin.apt: - name: plymouth + name: + - plymouth + - plymouth-themes + - plymouth-label when: ansible_distribution_major_version|int > 7 - name: Copies plymouth theme ansible.builtin.copy: src: "{{ item }}" dest: /usr/share/plymouth/themes/screenly/ - mode: 0644 + mode: "0644" owner: root group: root with_items: @@ -60,15 +70,22 @@ - splashscreen.png when: ansible_distribution_major_version|int > 7 +- name: Get current plymouth theme + ansible.builtin.command: plymouth-set-default-theme + register: plymouth_theme + changed_when: false + when: ansible_distribution_major_version|int > 7 + - name: Set splashscreen ansible.builtin.command: plymouth-set-default-theme -R screenly when: ansible_distribution_major_version|int > 7 + changed_when: plymouth_theme.stdout != "screenly" - name: Set plymouthd.default ansible.builtin.copy: src: plymouthd.default dest: /usr/share/plymouth/plymouthd.defaults - mode: 0644 + mode: "0644" owner: root group: root when: ansible_distribution_major_version|int > 7 @@ -77,7 +94,7 @@ ansible.builtin.copy: src: plymouthd.default dest: /etc/plymouth/plymouthd.conf - mode: 0644 + mode: "0644" owner: root group: root when: ansible_distribution_major_version|int > 7 diff --git a/ansible/roles/system/tasks/main.yml b/ansible/roles/system/tasks/main.yml index 7640ac0ae..4fbb6fd52 100644 --- a/ansible/roles/system/tasks/main.yml +++ b/ansible/roles/system/tasks/main.yml @@ -1,6 +1,10 @@ --- +- name: Create a config_path variable + ansible.builtin.set_fact: + config_path: "{{ '/boot/config.txt' if ansible_distribution_major_version|int <= 11 else '/boot/firmware/config.txt' }}" + - name: Check NOOBS - ansible.builtin.command: cat /boot/config.txt + ansible.builtin.command: cat {{ config_path }} register: config_txt changed_when: false tags: @@ -8,7 +12,7 @@ - name: Make sure we have proper framebuffer depth ansible.builtin.lineinfile: - dest: /boot/config.txt + dest: "{{ config_path }}" regexp: ^framebuffer_depth= line: framebuffer_depth=32 tags: @@ -16,7 +20,7 @@ - name: Fix framebuffer bug ansible.builtin.lineinfile: - dest: /boot/config.txt + dest: "{{ config_path }}" regexp: ^framebuffer_ignore_alpha= line: framebuffer_ignore_alpha=1 tags: @@ -24,7 +28,7 @@ - name: Add gpu_mem_256 in config.txt if it doesn't exist ansible.builtin.lineinfile: - path: /boot/config.txt + path: "{{ config_path }}" line: gpu_mem_256=96 when: config_txt.stdout.find('gpu_mem_256') == -1 tags: @@ -32,7 +36,7 @@ - name: Add gpu_mem_512 in config.txt if it doesn't exist ansible.builtin.lineinfile: - path: /boot/config.txt + path: "{{ config_path }}" line: gpu_mem_512=128 when: config_txt.stdout.find('gpu_mem_512') == -1 tags: @@ -40,23 +44,39 @@ - name: Add gpu_mem_1024 in config.txt if it doesn't exist ansible.builtin.lineinfile: - path: /boot/config.txt + path: "{{ config_path }}" line: gpu_mem_1024=196 when: config_txt.stdout.find('gpu_mem_1024') == -1 tags: - touches_boot_partition +- name: Add pi4 section in config.txt if it doesn't exist + ansible.builtin.lineinfile: + path: "{{ config_path }}" + line: "[pi4]" + when: config_txt.stdout.find('[pi4]') == -1 + - name: Comment out the original dtoverlay config. ansible.builtin.replace: - dest: /boot/config.txt + dest: "{{ config_path }}" regexp: ^(dtoverlay=vc4-kms-v3d)$ replace: '#\1' -- name: Add FKMS config for Pi 4. +- name: Add FKMS config for Pi 4. (<= Debian 11) + ansible.builtin.lineinfile: + path: "{{ config_path }}" + insertafter: '^\[pi4\]$' + line: dtoverlay=vc4-fkms-v3d + when: + - ansible_distribution_major_version|int <= 11 + +- name: Add FKMS config for Pi 4. (>= Debian 12) ansible.builtin.lineinfile: - path: /boot/config.txt + path: "{{ config_path }}" insertafter: '^\[pi4\]$' line: dtoverlay=vc4-fkms-v3d + when: + - ansible_distribution_major_version|int >= 12 - name: Backup kernel boot args ansible.builtin.copy: @@ -64,7 +84,7 @@ dest: /boot/cmdline.txt.orig owner: root group: root - mode: 0755 + mode: "0755" force: false tags: - touches_boot_partition @@ -79,7 +99,7 @@ dest: /boot/cmdline.txt owner: root group: root - mode: 0755 + mode: "0755" force: true when: config_txt.stdout.find('NOOBS') == -1 tags: @@ -225,7 +245,7 @@ state: present owner: root group: root - mode: 0644 + mode: "0644" - name: Install Docker ansible.builtin.apt: @@ -264,16 +284,26 @@ tags: - system-upgrade -- name: Remove deprecated pip dependencies +- name: Remove deprecated pip dependencies (<= Debian 11) + ansible.builtin.pip: + name: supervisor + state: absent + when: + - ansible_distribution_major_version|int <= 11 + +- name: Remove deprecated pip dependencies (>= Debian 12) ansible.builtin.pip: name: supervisor + executable: /home/{{ lookup('env', 'USER') }}/installer_venv/bin/pip state: absent + when: + - ansible_distribution_major_version|int >= 12 - name: Copy in rc.local ansible.builtin.copy: src: rc.local dest: /etc/rc.local - mode: 0755 + mode: "0755" owner: root group: root @@ -281,7 +311,7 @@ ansible.builtin.copy: src: 01_nodoc dest: /etc/dpkg/dpkg.cfg.d/01_nodoc - mode: 0644 + mode: "0644" owner: root group: root diff --git a/ansible/roles/tools/tasks/main.yml b/ansible/roles/tools/tasks/main.yml index b1a807709..39193768b 100644 --- a/ansible/roles/tools/tasks/main.yml +++ b/ansible/roles/tools/tasks/main.yml @@ -3,6 +3,6 @@ ansible.builtin.copy: src: ngrok dest: /usr/local/bin/ - mode: 0755 + mode: "0755" owner: root group: root diff --git a/bin/install.sh b/bin/install.sh index 9a5f50014..954ac8815 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -152,16 +152,23 @@ if [ ! -f /etc/locale.gen ]; then sudo locale-gen fi +RASPBIAN_VERSION=$(lsb_release -rs) +APT_INSTALL_ARGS=( + "git" + "libffi-dev" + "libssl-dev" + "whois" +) + +if [ "$RASPBIAN_VERSION" = "12" ]; then + APT_INSTALL_ARGS+=("python3-full") +else + APT_INSTALL_ARGS+=("python3" "python3-dev" "python3-pip") +fi + sudo sed -i 's/apt.screenlyapp.com/archive.raspbian.org/g' /etc/apt/sources.list sudo apt update -y -sudo apt-get install -y --no-install-recommends \ - git \ - libffi-dev \ - libssl-dev \ - python3 \ - python3-dev \ - python3-pip \ - whois +sudo apt-get install -y --no-install-recommends "${APT_INSTALL_ARGS[@]}" if [ "$NETWORK" == 'y' ]; then export MANAGE_NETWORK=true @@ -177,19 +184,27 @@ else ANSIBLE_VERSION=ansible==2.8.8 fi +SUDO_ARGS=() + +if [ "$RASPBIAN_VERSION" = "12" ]; then + python3 -m venv /home/${USER}/installer_venv + source /home/${USER}/installer_venv/bin/activate + + SUDO_ARGS+=("--preserve-env" "env" "PATH=$PATH") +fi + # @TODO # Remove me later. Cryptography 38.0.3 won't build at the moment. # See https://github.com/screenly/anthias/issues/1654 -sudo pip install cryptography==38.0.2 - -sudo pip install "$ANSIBLE_VERSION" +sudo ${SUDO_ARGS[@]} pip install cryptography==38.0.2 +sudo ${SUDO_ARGS[@]} pip install "$ANSIBLE_VERSION" -sudo -u ${USER} ansible localhost \ +sudo -u ${USER} ${SUDO_ARGS[@]} ansible localhost \ -m git \ -a "repo=$REPOSITORY dest=/home/${USER}/screenly version=$BRANCH force=no" cd /home/${USER}/screenly/ansible -sudo -E -u ${USER} ansible-playbook site.yml "${EXTRA_ARGS[@]}" +sudo -E -u ${USER} ${SUDO_ARGS[@]} ansible-playbook site.yml "${EXTRA_ARGS[@]}" # Pull down and install containers sudo -u ${USER} /home/${USER}/screenly/bin/upgrade_containers.sh