2022-04-23 09:48:05 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-10-06 23:09:20 +00:00
|
|
|
# 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."
|
|
|
|
|
|
|
|
# Ensure Sunshine can grab images from KMS
|
|
|
|
path_to_setcap=$(which setcap)
|
|
|
|
path_to_sunshine=$(readlink -f "$(which sunshine)")
|
|
|
|
if [ -x "$path_to_setcap" ] ; then
|
|
|
|
echo "Setting CAP_SYS_ADMIN capability on Sunshine binary."
|
|
|
|
echo "$path_to_setcap cap_sys_admin+p $path_to_sunshine"
|
|
|
|
$path_to_setcap cap_sys_admin+p $path_to_sunshine
|
|
|
|
echo "CAP_SYS_ADMIN capability set on Sunshine binary."
|
|
|
|
else
|
|
|
|
echo "error: setcap not found or not executable."
|
|
|
|
fi
|
2024-03-11 01:06:59 +00:00
|
|
|
|
2024-10-06 23:09:20 +00:00
|
|
|
# Trigger udev rule reload for /dev/uinput and /dev/uhid
|
|
|
|
path_to_udevadm=$(which udevadm)
|
|
|
|
if [ -x "$path_to_udevadm" ] ; then
|
|
|
|
echo "Reloading udev rules."
|
|
|
|
$path_to_udevadm control --reload-rules
|
|
|
|
$path_to_udevadm trigger --property-match=DEVNAME=/dev/uinput
|
|
|
|
$path_to_udevadm trigger --property-match=DEVNAME=/dev/uhid
|
|
|
|
echo "Udev rules reloaded successfully."
|
|
|
|
else
|
|
|
|
echo "error: udevadm not found or not executable."
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "rpm-ostree environment detected, skipping post install steps. Restart to apply the changes."
|
2024-03-11 01:06:59 +00:00
|
|
|
fi
|