diff --git a/srcpkgs/nvidia390/patches/linux-5.8.x.patch b/srcpkgs/nvidia390/patches/linux-5.8.x.patch new file mode 100644 index 00000000000..792cdb3afef --- /dev/null +++ b/srcpkgs/nvidia390/patches/linux-5.8.x.patch @@ -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 ++#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 diff --git a/srcpkgs/nvidia390/template b/srcpkgs/nvidia390/template index 8de5524fca7..9de46654319 100644 --- a/srcpkgs/nvidia390/template +++ b/srcpkgs/nvidia390/template @@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 400, 500 series)" pkgname=nvidia390 version=390.138 -revision=1 +revision=2 maintainer="Andrew Benson " 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