mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-12-02 10:05:50 +00:00
Extend udev rule reloading to cover hidraw and input subsystems so permissions are applied to dynamically created libvirtualhid gamepad child nodes, not just /dev/uinput and /dev/uhid. Also: - Always install the udev rules file regardless of whether libudev is detected at build time - Add Homebrew postinst support to copy rules to host-monitored directories - Trigger udevadm reload on rule removal (AppImage, Flatpak) - Update comments to say "gamepad emulation" instead of "DS5 emulation" - Add docs clarifying that manual chmod/setfacl changes are lost on reconnect and how to reload rules
28 lines
541 B
Plaintext
28 lines
541 B
Plaintext
# shellcheck shell=bash
|
|
|
|
do_setcap() {
|
|
setcap cap_sys_admin,cap_sys_nice+p "$(readlink -f usr/bin/sunshine)"
|
|
}
|
|
|
|
do_udev_reload() {
|
|
udevadm control --reload-rules
|
|
udevadm trigger --property-match=DEVNAME=/dev/uinput
|
|
udevadm trigger --property-match=DEVNAME=/dev/uhid
|
|
udevadm trigger --subsystem-match=hidraw
|
|
udevadm trigger --subsystem-match=input
|
|
modprobe uinput || true
|
|
modprobe uhid || true
|
|
}
|
|
|
|
post_install() {
|
|
do_setcap
|
|
do_udev_reload
|
|
modprobe uhid
|
|
}
|
|
|
|
post_upgrade() {
|
|
do_setcap
|
|
do_udev_reload
|
|
modprobe uhid
|
|
}
|