fix(packaging/Linux): ensure that uhid is loaded automatically (#2906)

Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
Gilles Schintgen
2025-09-23 05:30:21 +02:00
committed by GitHub
parent 6de97fdc18
commit fd96aa0b36
10 changed files with 40 additions and 22 deletions

View File

@@ -211,15 +211,13 @@ xvfb-run ./tests/test_sunshine
cd %{_builddir}/Sunshine/build
%make_install
# Add modules-load configuration
# load the uhid module in initramfs even if it doesn't detect the module as being used during dracut
# which must be run every time a new kernel is installed
install -D -m 0644 /dev/stdin %{buildroot}/usr/lib/modules-load.d/uhid.conf <<EOF
uhid
EOF
%post
# Note: this is copied from the postinst script
# Load uhid (DS5 emulation)
echo "Loading uhid kernel module for DS5 emulation."
modprobe uhid
# Check if we're in an rpm-ostree environment
if [ ! -x "$(command -v rpm-ostree)" ]; then
echo "Not in an rpm-ostree environment, proceeding with post install steps."
@@ -239,10 +237,6 @@ else
echo "rpm-ostree environment detected, skipping post install steps. Restart to apply the changes."
fi
%preun
# Remove modules-load configuration
rm -f /usr/lib/modules-load.d/uhid.conf
%files
# Executables
%caps(cap_sys_admin+p) %{_bindir}/sunshine
@@ -255,7 +249,7 @@ rm -f /usr/lib/modules-load.d/uhid.conf
%{_udevrulesdir}/*-sunshine.rules
# Modules-load configuration
%{_modulesloaddir}/uhid.conf
%{_modulesloaddir}/*-sunshine.conf
# Desktop entries
%{_datadir}/applications/*.desktop