forked from pool/nvidia-open-driver-G06-signed
Stefan Dirsch
be2de79d7b
redesign OBS-URL: https://build.opensuse.org/package/show/X11:Drivers:Video:Redesign/nvidia-open-driver-G06-signed?expand=0&rev=1
48 lines
1.9 KiB
Bash
48 lines
1.9 KiB
Bash
flavor=%1
|
|
|
|
# Create symlinks for udev so these devices will get user ACLs by logind later (bnc#1000625)
|
|
mkdir -p /run/udev/static_node-tags/uaccess
|
|
mkdir -p /usr/lib/tmpfiles.d
|
|
ln -snf /dev/nvidiactl /run/udev/static_node-tags/uaccess/nvidiactl
|
|
ln -snf /dev/nvidia-uvm /run/udev/static_node-tags/uaccess/nvidia-uvm
|
|
ln -snf /dev/nvidia-uvm-tools /run/udev/static_node-tags/uaccess/nvidia-uvm-tools
|
|
ln -snf /dev/nvidia-modeset /run/udev/static_node-tags/uaccess/nvidia-modeset
|
|
cat > /usr/lib/tmpfiles.d/nvidia-logind-acl-trick-G06.conf << EOF
|
|
L /run/udev/static_node-tags/uaccess/nvidiactl - - - - /dev/nvidiactl
|
|
L /run/udev/static_node-tags/uaccess/nvidia-uvm - - - - /dev/nvidia-uvm
|
|
L /run/udev/static_node-tags/uaccess/nvidia-uvm-tools - - - - /dev/nvidia-uvm-tools
|
|
L /run/udev/static_node-tags/uaccess/nvidia-modeset - - - - /dev/nvidia-modeset
|
|
EOF
|
|
devid=-1
|
|
for dev in $(ls -d /sys/bus/pci/devices/*); do
|
|
vendorid=$(cat $dev/vendor)
|
|
if [ "$vendorid" == "0x10de" ]; then
|
|
class=$(cat $dev/class)
|
|
classid=${class%%00}
|
|
if [ "$classid" == "0x0300" -o "$classid" == "0x0302" ]; then
|
|
devid=$((devid+1))
|
|
ln -snf /dev/nvidia${devid} /run/udev/static_node-tags/uaccess/nvidia${devid}
|
|
echo "L /run/udev/static_node-tags/uaccess/nvidia${devid} - - - - /dev/nvidia${devid}" >> /usr/lib/tmpfiles.d/nvidia-logind-acl-trick-G06.conf
|
|
fi
|
|
fi
|
|
done
|
|
|
|
# groups are now dynamic
|
|
%if 0%{?suse_version} >= 1550
|
|
if [ -f /usr/lib/modprobe.d/50-nvidia-$flavor.conf ]; then
|
|
%else
|
|
if [ -f /etc/modprobe.d/50-nvidia-$flavor.conf ]; then
|
|
%endif
|
|
VIDEOGID=`getent group video | cut -d: -f3`
|
|
%if 0%{?suse_version} >= 1550
|
|
sed -i "s/33/$VIDEOGID/" /usr/lib/modprobe.d/50-nvidia-$flavor.conf
|
|
%else
|
|
sed -i "s/33/$VIDEOGID/" /etc/modprobe.d/50-nvidia-$flavor.conf
|
|
%endif
|
|
fi
|
|
|
|
# Workaround needed on TW for simpledrm (boo#1201392)
|
|
%if 0%{?suse_version} >= 1550
|
|
pbl --add-option nosimplefb=1 --config
|
|
%endif
|