Skip to content

Commit

Permalink
[devkit] Handle touchscreen dtoverlay
Browse files Browse the repository at this point in the history
  • Loading branch information
goldyfruit committed May 12, 2024
1 parent 9b9999a commit 3da8eb1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ansible/roles/ovos_hardware_mark2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
- name: Include vocalfusion.yml
ansible.builtin.import_tasks: vocalfusion.yml

- name: Include touchscreen.yml
ansible.builtin.import_tasks: touchscreen.yml
when: "'attiny1614' in ovos_installer_i2c_devices"

- name: Include wireplumber.yml
ansible.builtin.import_tasks: wireplumber.yml
9 changes: 9 additions & 0 deletions ansible/roles/ovos_hardware_mark2/tasks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@
- /opt/sj201
- "{{ ovos_installer_user_home }}/.config/systemd/user"
- "{{ ovos_installer_user_home }}/.config/wireplumber/main.lua.d"

- name: Check for /boot/firmware directory
ansible.builtin.stat:
path: /boot/firmware
register: _boot_config_status

- name: Set _boot_directory fact
ansible.builtin.set_fact:
_boot_directory: "{{ '/boot/firmware' if _boot_config_status.stat.exists | bool else '/boot' }}"
10 changes: 10 additions & 0 deletions ansible/roles/ovos_hardware_mark2/tasks/touchscreen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Manage touchscreen, DevKit vs Mark II
ansible.builtin.lineinfile:
path: "{{ _boot_directory }}"
regexp: "^{{ item.overlay }}"
line: "{{ item.overlay }}"
state: "{{ item.state }}"
loop:
- {"overlay": "dtoverlay=vc4-kms-v3d", "state": "absent" }
- {"overlay": "dtoverlay=vc4-fkms-v3d", "state": "present" }
2 changes: 1 addition & 1 deletion ansible/roles/ovos_hardware_mark2/tasks/vocalfusion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
vars:
_is_rpi5: "{{ '-pi5' if 'Raspberry Pi 5' in ovos_installer_raspberrypi else '' }}"
ansible.builtin.lineinfile:
path: /boot/firmware/config.txt
path: "{{ _boot_directory }}"
regexp: "^{{ item }}="
line: "{{ item }}{{ _is_rpi5 }}"
loop:
Expand Down
2 changes: 1 addition & 1 deletion ansible/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version('11', '>=')
- "'Raspberry Pi 4' in ovos_installer_raspberrypi or 'Raspberry Pi 5' in ovos_installer_raspberrypi"
- "'tas5806' in ovos_installer_i2c_devices"
- ovos_installer_i2c_devices in ["tas5806", "attiny1614"]
- ansible_architecture == "aarch64"

- role: ovos_installer
Expand Down

0 comments on commit 3da8eb1

Please sign in to comment.