feat: Update launch scripts for improved Gamescope and Steam integration, add custom EDID firmware, and enhance session management

This commit is contained in:
2025-11-10 14:07:12 +01:00
parent df2931ca81
commit 0cf0261359
5 changed files with 241 additions and 25 deletions
+208 -5
View File
@@ -12,7 +12,7 @@
system_cores: "0,8"
general_cores: "2-7,10-15"
sunshine_cores: "1,9"
screen_resolution: "{{ lookup('env', 'GAME_RESOLUTION') | d('1280x720', true) }}"
screen_resolution: "{{ lookup('env', 'GAME_RESOLUTION') | d('1920x1080', true) }}"
screen_width: "{{ screen_resolution.split('x')[0] }}"
screen_height: "{{ screen_resolution.split('x')[1] }}"
hdr_enabled: "{{ lookup('env', 'HDR_ENABLED') | d('false', true) }}"
@@ -29,19 +29,171 @@
- threadirqs
- nohz_full=1-7,9-15
- rcu_nocbs=1-7,9-15
- drm.edid_firmware=DP-1:edid/aoc28e850.bin
- video=DP-1:e
nvidia_modules:
- nvidia
- nvidia_modeset
- nvidia_uvm
- nvidia_drm
appimages:
- name: Steam ROM Manager
url: "https://github.com/SteamGridDB/steam-rom-manager/releases/download/v2.5.30/Steam-ROM-Manager-2.5.30.AppImage"
executable: "SteamRomManager.AppImage"
link: "srm"
- name: RPCS3
url: "https://github.com/RPCS3/rpcs3-binaries-linux/releases/download/build-cc8929ef4a6142fa5b240d2f5ec19ead54cc6efa/rpcs3-v0.0.38-18287-cc8929ef_linux64.AppImage"
executable: "rpcs3.AppImage"
link: "rpcs3"
- name: Eden
url: "https://github.com/eden-emulator/Releases/releases/download/v0.0.4-rc1/Eden-Linux-v0.0.4-rc1-amd64-clang-standard.AppImage"
executable: "Eden.AppImage"
link: "eden"
tasks:
# --- Base dependencies ---
- name: Run 'dnf copr enable lizardbyte/stable'
- name: Enable COPR repositories
become: true
ansible.builtin.command: dnf copr enable -y lizardbyte/stable
failed_when: false
community.general.copr:
name: "{{ item }}"
state: enabled
loop:
- lizardbyte/stable
- atim/heroic-games-launcher
# --- CachyOS Kernel (conditional) ---
- name: Detect supported x86_64 ISA levels
ansible.builtin.shell:
cmd: |
set -euo pipefail;
/lib64/ld-linux-x86-64.so.2 --help | grep -F "(supported, searched)"
register: glibc_loader_help
changed_when: false
failed_when: false
- name: Determine CPU support for CachyOS kernel
ansible.builtin.set_fact:
has_x86_64_v3: "{{ ('x86-64-v3' in glibc_loader_help.stdout) or ('x86_64_v3' in glibc_loader_help.stdout) }}"
has_x86_64_v2: "{{ ('x86-64-v2' in glibc_loader_help.stdout) or ('x86_64_v2' in glibc_loader_help.stdout) }}"
- name: Debug CPU ISA detection
ansible.builtin.debug:
msg: "CPU supports x86_64_v3: {{ has_x86_64_v3 }}, x86_64_v2: {{ has_x86_64_v2 }}"
- name: Enable CachyOS COPR repository (kernel)
become: true
community.general.copr:
name: bieszczaders/kernel-cachyos
state: enabled
when: has_x86_64_v3 | bool or has_x86_64_v2 | bool
- name: Enable CachyOS COPR repository (addons)
become: true
community.general.copr:
name: bieszczaders/kernel-cachyos-addons
state: enabled
when: has_x86_64_v3 | bool or has_x86_64_v2 | bool
- name: Install CachyOS kernel for x86_64_v3 CPUs
become: true
ansible.builtin.dnf:
name:
- pesign
- openssl
- kernel-devel
- mokutil
- keyutils
- kernel-cachyos
- kernel-cachyos-devel
state: present
when: has_x86_64_v3 | bool
- name: Ensures user is on /etc/pesign/users
become: true
ansible.builtin.lineinfile:
path: /etc/pesign/users
line: "{{ ansible_user }}"
state: present
when: has_x86_64_v3 | bool
notify: Run pesign
- name: Run /usr/libexec/pesign/pesign-authorize
become: true
ansible.builtin.command: /usr/libexec/pesign/pesign-authorize
when: has_x86_64_v3 | bool
changed_when: false
# - name: Generate certificate for CachyOS kernel signing
# become: true
# ansible.builtin.shell: |
# openssl req -new -x509 -newkey rsa:2048 -keyout "key.pem" \
# -outform DER -out "cert.der" -nodes -days 36500 \
# -subj "/CN=CachyOS Secure Boot/" && \
# openssl pkcs12 -export -out key.p12 -inkey key.pem -in cert.der
# when: has_x86_64_v3 | bool
# changed_when: false
# args:
# executable: /bin/bash
# creates:
# - key.pem
# - cert.der
# - key.p12
# - name: Inform user to enroll MOK key
# ansible.builtin.debug:
# msg: |
# Please enroll the MOK key for kernel module signing on next reboot.
# Run:
# sudo certutil -A -i cert.der -n "CachyOS Secure Boot" -d /etc/pki/pesign/ -t "Pu,Pu,Pu" && \
# sudo pk12util -i key.p12 -d /etc/pki/pesign
# sudo mokutil --import cert.der' if not prompted automatically.
# when: has_x86_64_v3 | bool
- name: Create /etc/kernel/postinst.d directory
become: true
ansible.builtin.file:
path: /etc/kernel/postinst.d
state: directory
owner: root
group: root
mode: "0755"
- name: Enable Automatically signing kernel updates
become: true
ansible.builtin.copy:
dest: /etc/kernel/postinst.d/00-signing
owner: root
group: root
mode: "0755"
content: |
#!/bin/sh
set -e
KERNEL_IMAGE="$2"
MOK_KEY_NICKNAME="CachyOS Secure Boot"
if [ "$#" -ne "2" ] ; then
echo "Wrong count of command line arguments. This is not meant to be called directly." >&2
exit 1
fi
if [ ! -x "$(command -v pesign)" ] ; then
echo "pesign not executable. Bailing." >&2
exit 1
fi
if [ ! -w "$KERNEL_IMAGE" ] ; then
echo "Kernel image $KERNEL_IMAGE is not writable." >&2
exit 1
fi
echo "Signing $KERNEL_IMAGE..."
pesign --certificate "$MOK_KEY_NICKNAME" --in "$KERNEL_IMAGE" --sign --out "$KERNEL_IMAGE.signed"
mv "$KERNEL_IMAGE.signed" "$KERNEL_IMAGE"
- name: Install CachyOS LTS kernel for x86_64_v2-only CPUs
become: true
ansible.builtin.dnf:
name:
- kernel-cachyos-lts
- kernel-cachyos-lts-devel-matched
state: present
when: (not has_x86_64_v3 | bool) and (has_x86_64_v2 | bool)
- name: Ensure core gaming and streaming packages are installed
become: true
@@ -66,6 +218,8 @@
- waypipe
- drm-utils
- ethtool
- heroic-games-launcher-bin
- libva-nvidia-driver
state: present
- name: Ensure user namespaces are enabled
@@ -92,6 +246,35 @@
enabled: true
state: started
- name: Create firmware directory for EDID files
become: true
ansible.builtin.file:
path: /lib/firmware/edid
state: directory
owner: root
group: root
mode: "0755"
- name: Copy custom EDID file
become: true
ansible.builtin.copy:
dest: "/lib/firmware/edid/aoc28e850.bin"
owner: root
group: root
mode: "0644"
content: "{{ lookup('file', 'game_station/firmware/aoc28e850.bin') | b64decode }}"
- name: Ensure EDID file is available in initramfs
become: true
ansible.builtin.copy:
dest: /etc/dracut.conf.d/90-edid.conf
owner: root
group: root
mode: "0644"
content: |
install_items+=" /lib/firmware/edid/aoc28e850.bin "
notify: Run dracut
- name: Ensure NVIDIA modules are loaded at boot
become: true
ansible.builtin.copy:
@@ -313,6 +496,26 @@
daemon_reload: true
scope: user
- name: Install AppImages
become: true
ansible.builtin.get_url:
url: "{{ item.url }}"
dest: "/home/{{ user_name }}/.local/bin/{{ item.executable }}"
mode: "0755"
owner: "{{ user_name }}"
group: "{{ user_name }}"
loop: "{{ appimages }}"
- name: Create symlink for AppImages
become: true
ansible.builtin.file:
src: "/home/{{ user_name }}/.local/bin/{{ item.executable }}"
dest: "/home/{{ user_name }}/.local/bin/{{ item.link }}"
state: link
owner: "{{ user_name }}"
group: "{{ user_name }}"
loop: "{{ appimages }}"
- name: Download steamtools
become: true
ansible.builtin.get_url:
@@ -397,6 +600,6 @@
changed_when: false
- name: Run dracut
ansible.builtin.command: dracut --force
ansible.builtin.command: dracut --regenerate-all --force
become: true
changed_when: false