summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD54
-rw-r--r--kernel-4.16.patch33
3 files changed, 111 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..08f141f07559
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = nvidia-390xx-ck
+ pkgdesc = NVIDIA drivers for linux-ck, 390xx legacy branch.
+ pkgver = 390.48
+ pkgrel = 1
+ url = http://www.nvidia.com/
+ arch = x86_64
+ license = custom
+ makedepends = linux-ck-headers>=4.16
+ makedepends = linux-ck-headers<4.17
+ makedepends = nvidia-390xx-utils=390.48
+ depends = linux-ck>=4.16
+ depends = linux-ck<4.17
+ depends = libgl
+ depends = nvidia-390xx-utils=390.48
+ conflicts = nvidia-340xx-ck
+ conflicts = nvidia-ck
+ options = !strip
+ source = http://us.download.nvidia.com/XFree86/Linux-x86_64/390.48/NVIDIA-Linux-x86_64-390.48-no-compat32.run
+ source = kernel-4.16.patch
+ sha256sums = 2d4bf72801f101a85df6fd1464021380ad51f5a30df05dadaf1fb546a175a441
+ sha256sums = 622ac792ec200b2239cb663c0010392118b78c9904973d82cd261165c16d6385
+
+pkgname = nvidia-390xx-ck
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1641a592d72a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+# Maintainer: graysky <graysky AT archlnux.us>
+# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
+# Contrubutor: Thomas Baechler <thomas@archlinux.org>
+
+pkgname=nvidia-390xx-ck
+pkgver=390.48
+pkgrel=1
+_extramodules=extramodules-4.16-ck
+_pkgdesc="NVIDIA drivers for linux-ck, 390xx legacy branch."
+pkgdesc="$_pkgdesc"
+arch=('x86_64')
+url="http://www.nvidia.com/"
+makedepends=('linux-ck-headers>=4.16' 'linux-ck-headers<4.17' "nvidia-390xx-utils=${pkgver}")
+depends=('linux-ck>=4.16' 'linux-ck<4.17' 'libgl' "nvidia-390xx-utils=${pkgver}")
+conflicts=('nvidia-340xx-ck' 'nvidia-ck')
+#groups=('ck-generic')
+#replaces=()
+license=('custom')
+options=('!strip')
+source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
+kernel-4.16.patch)
+sha256sums=('2d4bf72801f101a85df6fd1464021380ad51f5a30df05dadaf1fb546a175a441'
+ '622ac792ec200b2239cb663c0010392118b78c9904973d82cd261165c16d6385')
+
+_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
+
+prepare() {
+ sh "${_pkg}.run" --extract-only
+ cd "${_pkg}"
+
+ # Restore phys_to_dma support (still needed for 396.18)
+ # https://bugs.archlinux.org/task/58074
+ patch -Np1 -i ../kernel-4.16.patch
+}
+
+build() {
+ _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
+ cd "${_pkg}"/kernel
+ make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
+}
+
+package() {
+ install -Dt "${pkgdir}/usr/lib/modules/${_extramodules}" -m644 \
+ "${srcdir}/${_pkg}/kernel"/nvidia{,-modeset,-drm,-uvm}.ko
+
+ find "${pkgdir}" -name '*.ko' -exec gzip -n {} +
+
+ echo "blacklist nouveau" |
+ install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/nvidia-390xx-ck.conf"
+
+ install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 "${srcdir}/${_pkg}/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/kernel-4.16.patch b/kernel-4.16.patch
new file mode 100644
index 000000000000..67172815ff69
--- /dev/null
+++ b/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();
+ }"