Commit a2b7d470 authored by nimrod's avatar nimrod
Browse files

Updates to the Kodi role and a little refactoring.

- Using the GBM backend for Kodi failed (maybe it's because I'm using
Flatpak, maybe not). Weston and Wayland failed (maybe the Weston version
in Buster is too old). Go back to good old Xorg.
- Configure Plymouth boot spalsh.
- Refactor GRUB and initramfs to the common debian_server role.
- Disable cgroup2 (unified hierarchy) because Docker in Buster doesn't
support it (Bullseye does) and with buster-backports it's now enabled by
default.
parent a7d19797
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
- hosts:
    - kodi
  roles:
    - debian_server
    - kodi
  become: true
  become_user: root
+8 −0
Original line number Diff line number Diff line
---
- name: Rebuild initramfs
  command:
    cmd: update-initramfs -u

- name: Update GRUB
  command:
    cmd: update-grub
+9 −0
Original line number Diff line number Diff line
@@ -5,6 +5,15 @@
      - ansible_distribution == "Debian"
      - ansible_distribution_major_version|int >= 10

- name: Disable cgroup2 for Docker
  lineinfile:
    backup: true
    line: |-
      GRUB_CMDLINE_LINUX_DEFAULT="quiet systemd.unified_cgroup_hierarchy=0"
    path: /etc/default/grub
  notify:
    - Update GRUB

- name: Enable the backports repo
  loop:
    - deb
+5 −15
Original line number Diff line number Diff line
[Unit]
Description=Kodi Media Center on %i
After=systemd-user-sessions.service sound.target network-online.target
After=systemd-user-sessions.service sound.target network-online.target xorg.service

# Require the library to be mounted.
After=srv-library.mount
@@ -12,27 +12,17 @@ After=dbus.socket
Conflicts=getty@%i.service
Before=graphical.target

# On systems without virtual consoles, don't start
ConditionPathExists=/dev/tty0

[Service]
User=kodi
PAMName=login
ExecStart=flatpak run --device=all --filesystem=/srv/library tv.kodi.Kodi --standalone --windowing=gbm -fs
Environment="DISPLAY=:0"
ExecStart=flatpak run --device=all --filesystem=/etc/group --filesystem=/srv/library tv.kodi.Kodi --standalone --windowing=x11 -fs
Type=simple
Restart=on-abort
Restart=always
RestartSec=5
KillMode=control-group

# A virtual terminal is needed.
TTYPath=/dev/%i
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

# Fail to start if not controlling the tty.
StandardOutput=tty
StandardInput=tty
StandardError=journal

# Log this user with utmp, letting it show up with commands 'w' and 'who'.
@@ -41,4 +31,4 @@ UtmpMode=user

[Install]
WantedBy=graphical.target
DefaultInstance=tty7
DefaultInstance=tty1
+41 −0
Original line number Diff line number Diff line
[Unit]
Description=X Windows display server
After=systemd-user-sessions.service

# D-Bus is necessary for contacting logind. Logind is required.
Wants=dbus.socket
After=dbus.socket

Conflicts=getty@tty7.service
Before=graphical.target

# On systems without virtual consoles, don't start
ConditionPathExists=/dev/tty7

[Service]
User=kodi
SupplementaryGroups=tty
PAMName=login
ExecStart=startx
Type=simple
Restart=on-abort
RestartSec=5
KillMode=control-group

# A virtual terminal is needed.
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

# Fail to start if not controlling the tty.
StandardOutput=tty
StandardInput=tty
StandardError=journal

# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier=tty7
UtmpMode=user

[Install]
WantedBy=graphical.target
Loading