summaryrefslogtreecommitdiff
path: root/x11-drivers/nvidia-legacy-drivers/files
diff options
context:
space:
mode:
Diffstat (limited to 'x11-drivers/nvidia-legacy-drivers/files')
-rw-r--r--x11-drivers/nvidia-legacy-drivers/files/kernel-4.16.patch33
-rw-r--r--x11-drivers/nvidia-legacy-drivers/files/nvidia-drm-outputclass.conf8
-rw-r--r--x11-drivers/nvidia-legacy-drivers/files/nvidia-legacy-drivers-390.132-conf.patch28
-rw-r--r--x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.conf8
-rw-r--r--x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.init24
-rw-r--r--x11-drivers/nvidia-legacy-drivers/files/nvidia-smi.init24
-rw-r--r--x11-drivers/nvidia-legacy-drivers/files/nvidia.conf3
7 files changed, 128 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-legacy-drivers/files/kernel-4.16.patch b/x11-drivers/nvidia-legacy-drivers/files/kernel-4.16.patch
new file mode 100644
index 00000000..67172815
--- /dev/null
+++ b/x11-drivers/nvidia-legacy-drivers/files/kernel-4.16.patch
@@ -0,0 +1,33 @@
+diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
+index 10fc418..22ef968 100644
+--- a/kernel/common/inc/nv-linux.h
++++ b/kernel/common/inc/nv-linux.h
+@@ -175,7 +175,11 @@ static inline uid_t __kuid_val(kuid_t uid)
+
+ #if defined(NV_VM_INSERT_PAGE_PRESENT)
+ #include <linux/pagemap.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
+ #include <linux/dma-mapping.h>
++#else
++#include <linux/dma-direct.h>
++#endif
+ #endif
+
+ #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64)
+diff --git a/kernel/conftest.sh b/kernel/conftest.sh
+index b23dbb4..42dc576 100755
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -1906,7 +1906,12 @@ compile_test() {
+ # Determine if the phys_to_dma function is present.
+ #
+ CODE="
++ #include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
+ #include <linux/dma-mapping.h>
++#else
++ #include <linux/dma-direct.h>
++#endif
+ void conftest_phys_to_dma(void) {
+ phys_to_dma();
+ }"
diff --git a/x11-drivers/nvidia-legacy-drivers/files/nvidia-drm-outputclass.conf b/x11-drivers/nvidia-legacy-drivers/files/nvidia-drm-outputclass.conf
new file mode 100644
index 00000000..9c36f59b
--- /dev/null
+++ b/x11-drivers/nvidia-legacy-drivers/files/nvidia-drm-outputclass.conf
@@ -0,0 +1,8 @@
+Section "OutputClass"
+ Identifier "nvidia"
+ MatchDriver "nvidia-drm"
+ Driver "nvidia"
+ Option "AllowEmptyInitialConfiguration"
+ ModulePath "/usr/lib/nvidia/xorg"
+ ModulePath "/usr/lib/xorg/modules"
+EndSection
diff --git a/x11-drivers/nvidia-legacy-drivers/files/nvidia-legacy-drivers-390.132-conf.patch b/x11-drivers/nvidia-legacy-drivers/files/nvidia-legacy-drivers-390.132-conf.patch
new file mode 100644
index 00000000..3ba17a8c
--- /dev/null
+++ b/x11-drivers/nvidia-legacy-drivers/files/nvidia-legacy-drivers-390.132-conf.patch
@@ -0,0 +1,28 @@
+diff -Nur a/kernel/dkms.conf b/kernel/dkms.conf
+--- a/kernel/dkms.conf 2018-03-22 05:39:53.000000000 +0000
++++ b/kernel/dkms.conf 2018-04-09 16:18:23.177125417 +0100
+@@ -1,12 +1,20 @@
+-PACKAGE_NAME="nvidia"
+-PACKAGE_VERSION="__VERSION_STRING"
++PACKAGE_NAME="nvidia-legacy-drivers-dkms"
++PACKAGE_VERSION="390.132"
+ AUTOINSTALL="yes"
+
+ # By default, DKMS will add KERNELRELEASE to the make command line; however,
+ # this will cause the kernel module build to infer that it was invoked via
+ # Kbuild directly instead of DKMS. The dkms(8) manual page recommends quoting
+ # the 'make' command name to suppress this behavior.
+-MAKE[0]="'make' -j__JOBS NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES' KERNEL_UNAME=${kernelver} modules"
++MAKE[0]="'make' -j`nproc` NV_EXCLUDE_BUILD_MODULES='__EXCLUDE_MODULES' KERNEL_UNAME=${kernelver} modules"
+
+ # The list of kernel modules will be generated by nvidia-installer at runtime.
+-__DKMS_MODULES
++BUILT_MODULE_NAME[0]="nvidia"
++DEST_MODULE_LOCATION[0]="/extra/dkms"
++BUILT_MODULE_NAME[1]="nvidia-uvm"
++DEST_MODULE_LOCATION[1]="/extra/dkms"
++BUILT_MODULE_NAME[2]="nvidia-modeset"
++DEST_MODULE_LOCATION[2]="/extra/dkms"
++BUILT_MODULE_NAME[3]="nvidia-drm"
++DEST_MODULE_LOCATION[3]="/extra/dkms"
++
diff --git a/x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.conf b/x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.conf
new file mode 100644
index 00000000..637ac1af
--- /dev/null
+++ b/x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.conf
@@ -0,0 +1,8 @@
+# run-time configuration file for /etc/init.d/nvidia-persistenced
+
+# NVPD_USER: The user nvidia-persistenced is intended to run for
+NVPD_USER=""
+
+# ARGS: Additional arguments to set the default persistence mode
+# (see nvidia-persistenced(1))
+ARGS=""
diff --git a/x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.init b/x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.init
new file mode 100644
index 00000000..f80456d1
--- /dev/null
+++ b/x11-drivers/nvidia-legacy-drivers/files/nvidia-persistenced.init
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/var/run/nvidia-persistenced/nvidia-persistenced.pid"
+
+start() {
+ if ! [ "${NVPD_USER}x" = x ]; then
+ ebegin "Starting nvidia-persistenced for ${NVPD_USER}"
+ NVPD_USER_ARG="--user ${NVPD_USER}"
+ else
+ ebegin "Starting nvidia-persistenced"
+ fi
+ start-stop-daemon --start --quiet --pidfile ${pidfile} \
+ --background --exec /opt/bin/nvidia-persistenced \
+ -- ${NVPD_USER_ARG} ${ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping nvidia-persistenced"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/x11-drivers/nvidia-legacy-drivers/files/nvidia-smi.init b/x11-drivers/nvidia-legacy-drivers/files/nvidia-smi.init
new file mode 100644
index 00000000..8ee51e34
--- /dev/null
+++ b/x11-drivers/nvidia-legacy-drivers/files/nvidia-smi.init
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/run/nvidia-smi.pid"
+
+depend() {
+ after modules
+}
+
+start() {
+ ebegin "Starting NVIDIA System Management Interface"
+ rm -f ${pidfile}
+ start-stop-daemon --start --quiet --pidfile ${pidfile} \
+ --make-pidfile --background --exec /opt/bin/nvidia-smi -- \
+ -q -l 300
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping NVIDIA System Management Interface"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/x11-drivers/nvidia-legacy-drivers/files/nvidia.conf b/x11-drivers/nvidia-legacy-drivers/files/nvidia.conf
new file mode 100644
index 00000000..00c6f588
--- /dev/null
+++ b/x11-drivers/nvidia-legacy-drivers/files/nvidia.conf
@@ -0,0 +1,3 @@
+blacklist nouveau
+options nouveau modeset=0
+alias nouveau off