diff options
author | Daniel Bermond | 2020-01-28 17:38:10 +0000 |
---|---|---|
committer | Daniel Bermond | 2020-01-28 17:56:44 +0000 |
commit | 4f7282538a8a418278e137e824ee3bc21b14c908 (patch) | |
tree | 49fffab8c6ff71a81f4a4f528e00adff492dbd58 | |
parent | 49c3e7891fa14f71205c36bb1f51b70d48ccbe98 (diff) | |
download | aur-4f7282538a8a418278e137e824ee3bc21b14c908.tar.gz |
Add fixes for linux 5.5, prime and FS#64317
- add patch to fix build for linux 5.5 (https://devtalk.nvidia.com/default/topic/1068332/linux/nvidia-driver-does-not-build-on-linux-v5-5-release-candidate-kernel/)
- add patch to fix prime for linux 5.4 (https://devtalk.nvidia.com/default/topic/1068045/5-4-kernel-breaks-prime-synchronization-/)
- remove patch for FS#62142 as reported by FS#64317
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | FS62142.patch | 12 | ||||
-rw-r--r-- | PKGBUILD | 37 |
3 files changed, 29 insertions, 28 deletions
@@ -1,7 +1,7 @@ pkgbase = nvidia-beta-all pkgdesc = NVIDIA drivers for all kernels on the system (beta version) pkgver = 440.44 - pkgrel = 1 + pkgrel = 2 url = https://www.nvidia.com/ arch = x86_64 license = custom @@ -14,9 +14,11 @@ pkgbase = nvidia-beta-all conflicts = nvidia options = !strip source = https://us.download.nvidia.com/XFree86/Linux-x86_64/440.44/NVIDIA-Linux-x86_64-440.44-no-compat32.run - source = FS62142.patch + source = 010-nvidia-prime-kernel-5.4.patch::https://gitlab.com/snippets/1929174/raw + source = 020-nvidia-kernel-5.5.patch::https://gitlab.com/snippets/1923197/raw sha256sums = 794fdfc8e65c203ae482f59df7e55050ddcf0a11af2a95eaa1a10c7d48ec7e0f - sha256sums = c961006882afb691410c017c239e2c2ef61badb88f15735d37112b513ef0a99d + sha256sums = bedd55074771222bad8391c66b7022a266c135ff51d478710f7dda8708c3e9aa + sha256sums = 7dcd609e85720cb812d7b41320d845931d8ea3e8529c700231372e0da66e5804 pkgname = nvidia-beta-all diff --git a/FS62142.patch b/FS62142.patch deleted file mode 100644 index 887f3366723e..000000000000 --- a/FS62142.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naurp a/kernel/nvidia/nv-dma.c b/kernel/nvidia/nv-dma.c ---- a/kernel/nvidia/nv-dma.c 2019-05-08 01:37:30.000000000 +0000 -+++ b/kernel/nvidia/nv-dma.c 2019-06-08 18:33:00.000000000 +0000 -@@ -613,7 +613,7 @@ static NvBool nv_dma_is_map_resource_imp - #endif - } - -- return (ops->map_resource != NULL); -+ return (ops && ops->map_resource); - #else - return NV_FALSE; - #endif @@ -1,10 +1,10 @@ -# Maintainer : Daniel Bermond < gmail-com: danielbermond > +# Maintainer : Daniel Bermond <dbermond@archlinux.org> # Contributor: Det <nimetonmaili g-mail> # Contributor: Ng Oon-Ee pkgname=nvidia-beta-all pkgver=440.44 -pkgrel=1 +pkgrel=2 pkgdesc='NVIDIA drivers for all kernels on the system (beta version)' arch=('x86_64') url='https://www.nvidia.com/' @@ -16,9 +16,11 @@ conflicts=('nvidia') options=('!strip') _pkg="NVIDIA-Linux-${CARCH}-${pkgver}-no-compat32" source=("https://us.download.nvidia.com/XFree86/Linux-${CARCH}/${pkgver}/${_pkg}.run" - 'FS62142.patch') + '010-nvidia-prime-kernel-5.4.patch::https://gitlab.com/snippets/1929174/raw' + '020-nvidia-kernel-5.5.patch::https://gitlab.com/snippets/1923197/raw') sha256sums=('794fdfc8e65c203ae482f59df7e55050ddcf0a11af2a95eaa1a10c7d48ec7e0f' - 'c961006882afb691410c017c239e2c2ef61badb88f15735d37112b513ef0a99d') + 'bedd55074771222bad8391c66b7022a266c135ff51d478710f7dda8708c3e9aa' + '7dcd609e85720cb812d7b41320d845931d8ea3e8529c700231372e0da66e5804') prepare() { # extract the source file @@ -26,21 +28,32 @@ prepare() { printf '%s\n' " -> Self-Extracting ${_pkg}.run..." sh "${_pkg}.run" --extract-only cd "${_pkg}" + mv kernel kernel-orig # create a build directory for each installed kernel local _kernel local -a _kernels + local _majver mapfile -t _kernels < <(find /usr/lib/modules/*/build/version -exec cat {} +) for _kernel in "${_kernels[@]}" do - cp -a kernel "kernel-${_kernel}" - printf '%s\n' " -> Applying patch(es) for kernel ${_kernel}..." - cd "kernel-${_kernel}" + _majver="$(printf "$_kernel" | sed -E 's/^([0-9]+\.[0-9]+).*/\1/')" + cp -a kernel-orig kernel - # fix https://bugs.archlinux.org/task/62142 - patch -Np2 -i "${srcdir}/FS62142.patch" + # current patches are for 5.4 and later only + if [ "$(vercmp "$_majver" '5.4')" -ge '0' ] + then + printf '%s\n' " -> Applying patch(es) for kernel ${_kernel}..." + patch -Np1 -i "${srcdir}/010-nvidia-prime-kernel-5.4.patch" + + if [ "$(vercmp "$_majver" '5.5')" -ge '0' ] + then + patch -Np1 -i "${srcdir}/020-nvidia-kernel-5.5.patch" + fi + fi - cd .. + mv kernel "kernel-${_kernel}" + cp -a .manifest ".manifest-${_kernel}" done } @@ -52,7 +65,7 @@ build() { for _kernel in "${_kernels[@]}" do cd "${srcdir}/${_pkg}/kernel-${_kernel}" - + cp -a "${srcdir}/${_pkg}/.manifest-${_kernel}" "${srcdir}/${_pkg}/.manifest" printf '%s\n' " -> Building Nvidia module for ${_kernel}..." make SYSSRC="/usr/lib/modules/${_kernel}/build" module done @@ -66,11 +79,9 @@ package() { for _kernel in "${_kernels[@]}" do install -D -m644 "${_pkg}/kernel-${_kernel}/"nvidia{,-drm,-modeset,-uvm}.ko -t "${pkgdir}/usr/lib/modules/${_kernel}/extramodules" - find "$pkgdir" -name '*.ko' -exec gzip -n {} + done printf '%s\n' 'blacklist nouveau' | install -D -m644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/nvidia.conf" - install -D -m644 "${_pkg}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" } |