nvidia390: remove nvidia-uvm for linux5.8

In nvidia-uvm.ko there is a reference to a GPL-only symbol
which does not work for a non-GPL driver like nvidia390.
This commit is contained in:
Jürgen Buchmüller 2020-09-14 20:30:01 +02:00
parent 689c871abe
commit 236108d05e
2 changed files with 38 additions and 9 deletions

View file

@ -0,0 +1,29 @@
--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h 2020-05-14 14:29:21.000000000 +0200
+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h 2020-09-10 21:56:45.927763032 +0200
@@ -531,7 +531,11 @@
static inline void *nv_vmalloc(unsigned long size)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
void *ptr = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
+#else
+ void *ptr = __vmalloc(size, GFP_KERNEL);
+#endif
if (ptr)
NV_MEMDBG_ADD(ptr, size);
return ptr;
--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-mm.h 2020-05-14 14:29:21.000000000 +0200
+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-mm.h 2020-09-10 22:25:40.666693863 +0200
@@ -29,6 +29,12 @@
typedef int vm_fault_t;
#endif
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+/* kernel 5.8.0-rc1 renamed mmap_sem to mmap_lock */
+#define mmap_sem mmap_lock
+#endif
+
/* get_user_pages
*
* The 8-argument version of get_user_pages was deprecated by commit

View file

@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 400, 500 series)"
pkgname=nvidia390
version=390.138
revision=1
revision=2
maintainer="Andrew Benson <abenson+void@gmail.com>"
license="custom:NVIDIA Proprietary"
homepage="https://www.nvidia.com"
@ -194,14 +194,14 @@ do_install() {
sed -e "s/__PKGVER/${version}/g" \
-e "s/__MAKEJOBS/-j$(nproc)/g" \
-i ${DESTDIR}/usr/src/nvidia-${version}/dkms.conf
if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
# nvidia no longer builds "uvm" submodule for 32-bit
# Remove 2 lines for "nvidia-uvm" and repair consecutive enumeration following.
sed -e '/nvidia-uvm/,+1d' \
-e 's/\[2\]/[1]/g' \
-e 's/\[3\]/[2]/g' \
-i ${DESTDIR}/usr/src/nvidia-${version}/dkms.conf
fi
# The "uvm" submodule uses GPL only symbols and can no longer be built.
# Remove 2 lines for "nvidia-uvm" and repair consecutive enumeration following.
vsed -e '/nvidia-uvm/,+1d' \
-e 's/\[2\]/[1]/g' \
-e 's/\[3\]/[2]/g' \
-i ${DESTDIR}/usr/src/nvidia-${version}/dkms.conf
vsed -e 's/ nvidia-uvm//' \
-i ${DESTDIR}/usr/src/nvidia-${version}/Makefile
# Blacklist nouveau
vmkdir usr/lib/modprobe.d