diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2021-07-21 11:07:28 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2021-07-21 15:42:50 -0400 |
commit | 1ba9301cc981065ed7f229cb28db7544a35c18e4 (patch) | |
tree | 5cb9dae7c93c7a7e4fb5283ba4fc4da8f76a35d8 /x11-drivers | |
parent | x11-drivers/nvidia-drivers: rename 390.xx filesdir files (diff) | |
download | gentoo-1ba9301cc981065ed7f229cb28db7544a35c18e4.tar.gz gentoo-1ba9301cc981065ed7f229cb28db7544a35c18e4.tar.bz2 gentoo-1ba9301cc981065ed7f229cb28db7544a35c18e4.zip |
x11-drivers/nvidia-drivers: normalize nvidia-*.conf contents
Options are unchanged (no real need for revbump), but
merges files not to pollute systems.
Also update README.gentoo so users are aware of this file.
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'x11-drivers')
12 files changed, 124 insertions, 123 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-390.conf b/x11-drivers/nvidia-drivers/files/nvidia-390.conf index a96b0cd1e40f..c873f00c462c 100644 --- a/x11-drivers/nvidia-drivers/files/nvidia-390.conf +++ b/x11-drivers/nvidia-drivers/files/nvidia-390.conf @@ -1,14 +1,21 @@ -# Nvidia drivers support +# NVIDIA drivers options +# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. + +# nvidia-drivers and nouveau cannot be used at same time. +# Comment out the following line if you wish to allow nouveau. +blacklist nouveau + +# !!! Security Warning !!! +# Do not change the DeviceFile options unless you know what you are doing. +# Only add trusted users to the 'video' group, these users may be able to +# crash, compromise, or irreparably damage the machine. +options nvidia \ + NVreg_DeviceFileGID=@VIDEOGID@ \ + NVreg_DeviceFileMode=432 \ + NVreg_DeviceFileUID=0 \ + NVreg_ModifyDeviceFiles=1 + +# Should be no need to touch anything below. alias char-major-195 nvidia alias /dev/nvidiactl char-major-195 - -# To tweak the driver the following options can be used, note that -# you should be careful, as it could cause instability!! For more -# options see /usr/share/doc/PACKAGE/README -# -# !!! SECURITY WARNING !!! -# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW -# WHAT YOU ARE DOING. -# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH, -# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE. -options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1 +remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-430.conf b/x11-drivers/nvidia-drivers/files/nvidia-430.conf deleted file mode 100644 index edd957b58c4e..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-430.conf +++ /dev/null @@ -1,20 +0,0 @@ -# Nvidia drivers support -alias char-major-195 nvidia -alias /dev/nvidiactl char-major-195 - -# To tweak the driver the following options can be used, note that -# you should be careful, as it could cause instability!! For more -# options see README.txt in /usr/share/doc/PACKAGE -# -# !!! SECURITY WARNING !!! -# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW -# WHAT YOU ARE DOING. -# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH, -# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE. -options nvidia \ - NVreg_DeviceFileGID=VIDEOGID \ - NVreg_DeviceFileMode=432 \ - NVreg_DeviceFileUID=0 \ - NVreg_ModifyDeviceFiles=1 \ - NVreg_PreserveVideoMemoryAllocations=1 \ - NVreg_TemporaryFilePath=/var/tmp diff --git a/x11-drivers/nvidia-drivers/files/nvidia-450.conf b/x11-drivers/nvidia-drivers/files/nvidia-450.conf new file mode 100644 index 000000000000..fe162045a132 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-450.conf @@ -0,0 +1,30 @@ +# NVIDIA drivers options +# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. + +# nvidia-drivers and nouveau cannot be used at same time. +# Comment out the following line if you wish to allow nouveau. +blacklist nouveau + +# Kernel Mode Setting (needed for PRIME offloading, and EGLStream/Wayland) +# This may need to be disabled if using SLI (Scalable Link Interface). +#options nvidia-drm modeset=1 + +# Suspend options. +options nvidia \ + NVreg_PreserveVideoMemoryAllocations=1 \ + NVreg_TemporaryFilePath=/var/tmp + +# !!! Security Warning !!! +# Do not change the DeviceFile options unless you know what you are doing. +# Only add trusted users to the 'video' group, these users may be able to +# crash, compromise, or irreparably damage the machine. +options nvidia \ + NVreg_DeviceFileGID=@VIDEOGID@ \ + NVreg_DeviceFileMode=432 \ + NVreg_DeviceFileUID=0 \ + NVreg_ModifyDeviceFiles=1 + +# Should be no need to touch anything below. +alias char-major-195 nvidia +alias /dev/nvidiactl char-major-195 +remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-460.conf b/x11-drivers/nvidia-drivers/files/nvidia-460.conf deleted file mode 100644 index 03967faa577a..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-460.conf +++ /dev/null @@ -1,20 +0,0 @@ -# Nvidia drivers support -alias char-major-195 nvidia -alias /dev/nvidiactl char-major-195 - -# To tweak the driver the following options can be used, note that -# you should be careful, as it could cause instability!! For more -# options see README.txt in /usr/share/doc/PACKAGE -# -# !!! SECURITY WARNING !!! -# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW -# WHAT YOU ARE DOING. -# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH, -# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE. -options nvidia \ - NVreg_DeviceFileGID=VIDEOGID \ - NVreg_DeviceFileMode=432 \ - NVreg_DeviceFileUID=0 \ - NVreg_ModifyDeviceFiles=1 \ - NVreg_PreserveVideoMemoryAllocations=0 \ - NVreg_TemporaryFilePath=/var/tmp diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/x11-drivers/nvidia-drivers/files/nvidia-470.conf index 4e363d2b2780..2c1ffd715f02 100644 --- a/x11-drivers/nvidia-drivers/files/nvidia-470.conf +++ b/x11-drivers/nvidia-drivers/files/nvidia-470.conf @@ -1,4 +1,4 @@ -# NVIDIA modules options +# NVIDIA drivers options # See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. # nvidia-drivers and nouveau cannot be used at same time. diff --git a/x11-drivers/nvidia-drivers/files/nvidia-blacklist-nouveau.conf b/x11-drivers/nvidia-drivers/files/nvidia-blacklist-nouveau.conf deleted file mode 100644 index b15fe0a3d92b..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-blacklist-nouveau.conf +++ /dev/null @@ -1,3 +0,0 @@ -# NVIDIA's official drivers and nouveau cannot be used at same time. -# Comment out the following line if you wish to allow nouveau. -blacklist nouveau diff --git a/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf b/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf deleted file mode 100644 index 618b9b30b86d..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Nvidia UVM support - -remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild index 4d8f0d912d03..d90fd0158f56 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.143-r1.ebuild @@ -76,19 +76,13 @@ PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-390.141-fno-common.patch ) + DOCS=( README.txt NVIDIA_Changelog nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt ) HTML_DOCS=( html/. ) -DISABLE_AUTOFORMATTING="yes" -DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video - -For general information on using nvidia-drivers, please see: -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" - pkg_setup() { use driver || return @@ -269,8 +263,6 @@ src_install() { insinto /etc/modprobe.d newins "${FILESDIR}"/nvidia-390.conf nvidia.conf - doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf - doins "${FILESDIR}"/nvidia-rmmod.conf fi if use X; then @@ -345,8 +337,19 @@ src_install() { # install prebuilt-only libraries multilib_foreach_abi nvidia-drivers_libs_install - einstalldocs + # create README.gentoo + local DISABLE_AUTOFORMATTING="yes" + local DOC_CONTENTS=\ +"Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options. + +For general information on using nvidia-drivers, please see: +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" readme.gentoo_create_doc + + einstalldocs } pkg_preinst() { @@ -358,8 +361,7 @@ pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(getent group video | cut -d: -f3) [[ ${g} ]] || die "Failed to determine video group id" - sed "s/PACKAGE/${PF}/;s/VIDEOGID/${g}/" \ - -i "${ED}"/etc/modprobe.d/nvidia.conf || die + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die } pkg_postinst() { diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-450.119.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-450.119.03.ebuild index 5ca8a76ea976..002882338055 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-450.119.03.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-450.119.03.ebuild @@ -75,19 +75,13 @@ QA_PREBUILT="opt/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch ) + DOCS=( README.txt NVIDIA_Changelog supported-gpus.json nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt ) HTML_DOCS=( html/. ) -DISABLE_AUTOFORMATTING="yes" -DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video - -For general information on using nvidia-drivers, please see: -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" - pkg_setup() { use driver || return @@ -263,9 +257,7 @@ src_install() { linux-mod_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-430.conf nvidia.conf - doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf - doins "${FILESDIR}"/nvidia-rmmod.conf + newins "${FILESDIR}"/nvidia-450.conf nvidia.conf # used for gpu verification with binpkgs (not kept) insinto /usr/share/nvidia @@ -352,8 +344,19 @@ src_install() { dobin nvidia-sleep.sh systemd_dounit nvidia-{hibernate,resume,suspend}.service - einstalldocs + # create README.gentoo + local DISABLE_AUTOFORMATTING="yes" + local DOC_CONTENTS=\ +"Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options. + +For general information on using nvidia-drivers, please see: +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" readme.gentoo_create_doc + + einstalldocs } pkg_preinst() { @@ -363,8 +366,7 @@ pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(getent group video | cut -d: -f3) [[ ${g} ]] || die "Failed to determine video group id" - sed "s/PACKAGE/${PF}/;s/VIDEOGID/${g}/" \ - -i "${ED}"/etc/modprobe.d/nvidia.conf || die + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild index 81f6e62f3d37..44fb2c8fbf5e 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-460.67.ebuild @@ -75,19 +75,13 @@ QA_PREBUILT="opt/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch ) + DOCS=( README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt ) HTML_DOCS=( html/. ) -DISABLE_AUTOFORMATTING="yes" -DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video - -For general information on using nvidia-drivers, please see: -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" - pkg_setup() { use driver || return @@ -262,9 +256,7 @@ src_install() { linux-mod_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-460.conf nvidia.conf - doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf - doins "${FILESDIR}"/nvidia-rmmod.conf + newins "${FILESDIR}"/nvidia-470.conf nvidia.conf # used for gpu verification with binpkgs (not kept) insinto /usr/share/nvidia @@ -351,8 +343,19 @@ src_install() { dobin nvidia-sleep.sh systemd_dounit nvidia-{hibernate,resume,suspend}.service - einstalldocs + # create README.gentoo + local DISABLE_AUTOFORMATTING="yes" + local DOC_CONTENTS=\ +"Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options. + +For general information on using nvidia-drivers, please see: +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" readme.gentoo_create_doc + + einstalldocs } pkg_preinst() { @@ -362,8 +365,7 @@ pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(getent group video | cut -d: -f3) [[ ${g} ]] || die "Failed to determine video group id" - sed "s/PACKAGE/${PF}/;s/VIDEOGID/${g}/" \ - -i "${ED}"/etc/modprobe.d/nvidia.conf || die + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-460.84.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-460.84.ebuild index ffd73239e934..8931c3443b48 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-460.84.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-460.84.ebuild @@ -74,19 +74,13 @@ QA_PREBUILT="opt/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch ) + DOCS=( README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt ) HTML_DOCS=( html/. ) -DISABLE_AUTOFORMATTING="yes" -DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video - -For general information on using nvidia-drivers, please see: -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" - pkg_setup() { use driver || return @@ -256,9 +250,7 @@ src_install() { linux-mod_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-460.conf nvidia.conf - doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf - doins "${FILESDIR}"/nvidia-rmmod.conf + newins "${FILESDIR}"/nvidia-470.conf nvidia.conf # used for gpu verification with binpkgs (not kept) insinto /usr/share/nvidia @@ -345,8 +337,19 @@ src_install() { dobin nvidia-sleep.sh systemd_dounit nvidia-{hibernate,resume,suspend}.service - einstalldocs + # create README.gentoo + local DISABLE_AUTOFORMATTING="yes" + local DOC_CONTENTS=\ +"Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options. + +For general information on using nvidia-drivers, please see: +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" readme.gentoo_create_doc + + einstalldocs } pkg_preinst() { @@ -356,8 +359,7 @@ pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(getent group video | cut -d: -f3) [[ ${g} ]] || die "Failed to determine video group id" - sed "s/PACKAGE/${PF}/;s/VIDEOGID/${g}/" \ - -i "${ED}"/etc/modprobe.d/nvidia.conf || die + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.42.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.42.01.ebuild index e93f07b1e500..20b2a56e4ec8 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.42.01.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.42.01.ebuild @@ -74,19 +74,13 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch ) + DOCS=( README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt ) HTML_DOCS=( html/. ) -DISABLE_AUTOFORMATTING="yes" -DOC_CONTENTS="Users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video - -For general information on using nvidia-drivers, please see: -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" - pkg_setup() { use driver || return @@ -274,9 +268,7 @@ src_install() { linux-mod_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-460.conf nvidia.conf - doins "${FILESDIR}"/nvidia-blacklist-nouveau.conf - doins "${FILESDIR}"/nvidia-rmmod.conf + newins "${FILESDIR}"/nvidia-470.conf nvidia.conf insinto /lib/firmware/nvidia/${PV} doins firmware/gsp.bin @@ -370,8 +362,19 @@ src_install() { dobin systemd/nvidia-sleep.sh systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service - einstalldocs + # create README.gentoo + local DISABLE_AUTOFORMATTING="yes" + local DOC_CONTENTS=\ +"Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options. + +For general information on using nvidia-drivers, please see: +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" readme.gentoo_create_doc + + einstalldocs } pkg_preinst() { @@ -381,8 +384,7 @@ pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(getent group video | cut -d: -f3) [[ ${g} ]] || die "Failed to determine video group id" - sed "s/PACKAGE/${PF}/;s/VIDEOGID/${g}/" \ - -i "${ED}"/etc/modprobe.d/nvidia.conf || die + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do |