ensure 'tuned-ppd' is absent (Fedora 41), +gamescope RT

This commit is contained in:
Josh Lay 2024-11-09 04:04:25 -06:00
parent 1c96e21f6f
commit e4d6723c8c
No known key found for this signature in database
GPG key ID: 47AA304B2243B579
2 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,33 @@
#!/bin/bash
#
# script run by 'tuned' to ensure gamescope has the proper capability
# Check for arguments
if [ $# -eq 0 ]; then
echo "Usage: $0 {verify|start}"
exit 1
fi
function verify_cap() {
/usr/sbin/getcap "$(which gamescope)" |& grep 'sys_nice=eip'
return $?
}
function set_cap() {
/usr/sbin/setcap 'CAP_SYS_NICE=eip' "$(which gamescope)"
}
# Handle arguments
case "$1" in
verify)
verify_cap
;;
start)
set_cap
;;
*)
echo "Invalid argument. Use 'verify' or 'start'."
exit 1
;;
esac

View file

@ -22,6 +22,12 @@
state: present state: present
become: true become: true
- name: Ensure 'tuned-ppd' is absent
ansible.builtin.package:
name: tuned-ppd
state: absent
become: true
- name: Find bundled 'tuned' profiles - name: Find bundled 'tuned' profiles
ansible.builtin.find: ansible.builtin.find:
paths: paths:
@ -85,6 +91,15 @@
notify: Restart tuned notify: Restart tuned
become: true become: true
- name: Copy gamescope RT capability script
ansible.builtin.copy:
src: rt_gamescope.sh
dest: /etc/tuned/rt_gamescope.sh
owner: root
group: root
mode: '0755'
become: true
- name: Template tuned.conf for custom profiles - name: Template tuned.conf for custom profiles
ansible.builtin.template: ansible.builtin.template:
src: templates/tuned.conf.j2 src: templates/tuned.conf.j2