Skip to content

Commit

Permalink
Fixes the Anthias installer so that it'll work on Debian Bookworm as …
Browse files Browse the repository at this point in the history
…well (#1836)
  • Loading branch information
nicomiguelino authored Apr 2, 2024
1 parent 98241b8 commit 503498e
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 46 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 8 additions & 1 deletion ansible/roles/network/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
24 changes: 16 additions & 8 deletions ansible/roles/screenly/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
state: directory
owner: "{{ lookup('env', 'USER') }}"
group: "{{ lookup('env', 'USER') }}"
mode: 0755
mode: "0755"
with_items:
- .screenly
- .config
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -55,31 +63,31 @@
ansible.builtin.copy:
src: screenly_overrides
dest: /etc/sudoers.d/screenly_overrides
mode: 0440
mode: "0440"
owner: root
group: root

- name: Copy screenly_usb_assets.sh
ansible.builtin.copy:
src: screenly_usb_assets.sh
dest: /usr/local/bin/screenly_usb_assets.sh
mode: 0755
mode: "0755"
owner: root
group: root

- name: Installs autoplay udev rule
ansible.builtin.copy:
src: 50-autoplay.rules
dest: /etc/udev/rules.d/50-autoplay.rules
mode: 0644
mode: "0644"
owner: root
group: root

- name: Copy systemd-udevd service
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

Expand All @@ -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 }}"
Expand Down
29 changes: 23 additions & 6 deletions ansible/roles/splashscreen/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
60 changes: 45 additions & 15 deletions ansible/roles/system/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,90 @@
---
- 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' }}"

Check warning on line 4 in ansible/roles/system/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

jinja[spacing]

Jinja2 spacing could be improved: {{ '/boot/config.txt' if ansible_distribution_major_version|int <= 11 else '/boot/firmware/config.txt' }} -> {{ '/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:
- touches_boot_partition

- 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:
- touches_boot_partition

- name: Fix framebuffer bug
ansible.builtin.lineinfile:
dest: /boot/config.txt
dest: "{{ config_path }}"
regexp: ^framebuffer_ignore_alpha=
line: framebuffer_ignore_alpha=1
tags:
- touches_boot_partition

- 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:
- touches_boot_partition

- 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:
- touches_boot_partition

- 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:
src: /boot/cmdline.txt
dest: /boot/cmdline.txt.orig
owner: root
group: root
mode: 0755
mode: "0755"
force: false
tags:
- touches_boot_partition
Expand All @@ -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:
Expand Down Expand Up @@ -225,7 +245,7 @@
state: present
owner: root
group: root
mode: 0644
mode: "0644"

- name: Install Docker
ansible.builtin.apt:
Expand Down Expand Up @@ -264,24 +284,34 @@
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

- name: Copy in 01_nodoc
ansible.builtin.copy:
src: 01_nodoc
dest: /etc/dpkg/dpkg.cfg.d/01_nodoc
mode: 0644
mode: "0644"
owner: root
group: root

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/tools/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
ansible.builtin.copy:
src: ngrok
dest: /usr/local/bin/
mode: 0755
mode: "0755"
owner: root
group: root
Loading

0 comments on commit 503498e

Please sign in to comment.