Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the Anthias installer so that it'll work on Debian Bookworm as well #1836

Merged
merged 51 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
240caf5
fix: Add temporary code for testing the installer script.
nicomiguelino Oct 23, 2023
75063e0
fix: Try not installing the `cryptography` installer.
nicomiguelino Oct 23, 2023
25bcf5e
fix: Use the `--break-system-packages` flag as a workaround.
nicomiguelino Oct 23, 2023
6f7672c
fix: Use the `--break-system-packages` flag in Ansible script.
nicomiguelino Oct 23, 2023
c3d4adb
fix: Use the `--break-system-packages` flag in Ansible script.
nicomiguelino Oct 23, 2023
a43cddf
fix: Check if the service `dhcpcd` exists before disabling it.
nicomiguelino Oct 24, 2023
a6301f7
fix: Install other plymouth dependencies.
nicomiguelino Oct 24, 2023
f4b0d7e
workaround: Comment out all `splashscreen` tasks in the meantime.
nicomiguelino Oct 24, 2023
7b9a5a4
style: Remove personal comments.
nicomiguelino Oct 25, 2023
ca04fd6
workaround: Comment out the `splashscreen` first.
nicomiguelino Oct 25, 2023
afad3e6
fix: Uncomment the `splashscreen` role.
nicomiguelino Oct 25, 2023
d63e206
workaround: Disable all but the `system` Ansible role.
nicomiguelino Oct 25, 2023
e2e0454
Workaround: Disable the `system` Ansible role as well.
nicomiguelino Oct 26, 2023
be965e2
debug: Comment out most of the tasks inside the `system` set.
nicomiguelino Oct 26, 2023
b76f420
debug: Uncomment a `system` task.
nicomiguelino Oct 26, 2023
bb4ee00
debug: Uncomment out a few other `system` tasks.
nicomiguelino Oct 26, 2023
02f2087
ddebug: Uncomment some tasks.
nicomiguelino Oct 26, 2023
317443e
debug: Uncomment a `system` task.
nicomiguelino Oct 26, 2023
993fdd9
debug: Uncomment the part where FKMS is being enabled.
nicomiguelino Oct 26, 2023
95e82ae
debug: Uncomment out the previously-commented Ansible tasks.
nicomiguelino Oct 26, 2023
cbbeed6
debug: Comment out the part where FKMS is being enabled on Pi 4.
nicomiguelino Oct 26, 2023
1c8cd06
style: Remove the commented-out FKMS step.
nicomiguelino Oct 26, 2023
adb2427
fix: Make the changes backwards-compatible
nicomiguelino Oct 26, 2023
98aaaee
fix: Fix syntax error in the install script.
nicomiguelino Oct 26, 2023
d660e7b
style: Resolve Ansible `octal-values` errors.
nicomiguelino Oct 30, 2023
0eaa69a
style: Resolve more Ansible `octal-values` errors.
nicomiguelino Oct 30, 2023
28cc0b6
style: Resolve remaining Ansible `octal-values` errors.
nicomiguelino Oct 30, 2023
2779204
style: Fix a `no-changed-when` Ansible linting issue.
nicomiguelino Oct 30, 2023
ec477a6
fix: Remove an unnecessary Ansible task that causes linting errors.
nicomiguelino Oct 31, 2023
2b34b36
fix: Add a `changed_when` condition when disabling `asplashscreen`.
nicomiguelino Oct 31, 2023
7f9ad09
fix: Fix the remaining Ansible linting error.
nicomiguelino Oct 31, 2023
f3738fa
fix: Use `ansible.builtin.command` instead of `ansible.builtin.shell`.
nicomiguelino Oct 31, 2023
fab4126
docs: Update compatibility-related info in the docs.
nicomiguelino Nov 1, 2023
4ca9b7c
refactor: Use `lsb_release` instead of `cat`-ing `/etc/os-release`.
nicomiguelino Nov 7, 2023
ed013ac
fix: Remove the use of `--break-system-packages` in the installer.
nicomiguelino Nov 8, 2023
08b6698
fix: Don't append `sudo` to `pip` for Bookworm.
nicomiguelino Nov 8, 2023
8fa62dd
fix: Ensure `sudo` works well with activated `venv` environment.
nicomiguelino Nov 8, 2023
12206ea
fix: Have `venv` create a new virtual env in other folder.
nicomiguelino Nov 8, 2023
5252af9
fix: Resolve typo in `venv` path.
nicomiguelino Nov 8, 2023
c52c87a
style: Remove unnecessary comments from the installer.
nicomiguelino Nov 8, 2023
eba413d
fix: Make `pip` recognizable as a command.
nicomiguelino Nov 8, 2023
d9309d7
fix: Make `pip` recognizable as a command.
nicomiguelino Nov 9, 2023
c413f94
fix: Make use of the USER environment variable.
nicomiguelino Nov 9, 2023
1458917
fix: Enable FKMS for Pi 4 devices running Debian 11 and older.
nicomiguelino Dec 22, 2023
2efb7a4
Merge branch 'master' into fix-installer
nicomiguelino Dec 27, 2023
4a4b530
Merge branch 'master' into fix-installer
nicomiguelino Apr 1, 2024
8d54575
fix: Enable FKMS on Pi 4 devices running Debian 12.
nicomiguelino Apr 1, 2024
b357b9e
fix: Tweak `/boot/firmware/config.txt` for Debian >= 12.
nicomiguelino Apr 1, 2024
a593817
fix: Read `/boot/firmware/config.txt` if OS is Debian 12.
nicomiguelino Apr 1, 2024
943f44c
fix: Fix Ansible syntax errors.
nicomiguelino Apr 2, 2024
78cda55
fix: Remove temporary changes from the install script.
nicomiguelino Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
nicomiguelino marked this conversation as resolved.
Show resolved Hide resolved
- 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
Loading