[arch-commits] Commit in nvidia-340xx/repos (18 files)

Tobias Powalowski tpowa at archlinux.org
Mon Mar 20 13:41:18 UTC 2017


    Date: Monday, March 20, 2017 @ 13:41:18
  Author: tpowa
Revision: 291107

db-move: moved nvidia-340xx from [testing] to [extra] (i686, x86_64)

Added:
  nvidia-340xx/repos/extra-i686/4.10.0_kernel.patch
    (from rev 291106, nvidia-340xx/repos/testing-i686/4.10.0_kernel.patch)
  nvidia-340xx/repos/extra-i686/PKGBUILD
    (from rev 291106, nvidia-340xx/repos/testing-i686/PKGBUILD)
  nvidia-340xx/repos/extra-i686/fs52243.patch
    (from rev 291106, nvidia-340xx/repos/testing-i686/fs52243.patch)
  nvidia-340xx/repos/extra-i686/nvidia-340xx.install
    (from rev 291106, nvidia-340xx/repos/testing-i686/nvidia-340xx.install)
  nvidia-340xx/repos/extra-x86_64/4.10.0_kernel.patch
    (from rev 291106, nvidia-340xx/repos/testing-x86_64/4.10.0_kernel.patch)
  nvidia-340xx/repos/extra-x86_64/PKGBUILD
    (from rev 291106, nvidia-340xx/repos/testing-x86_64/PKGBUILD)
  nvidia-340xx/repos/extra-x86_64/fs52243.patch
    (from rev 291106, nvidia-340xx/repos/testing-x86_64/fs52243.patch)
  nvidia-340xx/repos/extra-x86_64/nvidia-340xx.install
    (from rev 291106, nvidia-340xx/repos/testing-x86_64/nvidia-340xx.install)
Deleted:
  nvidia-340xx/repos/extra-i686/4.10.0_kernel.patch
  nvidia-340xx/repos/extra-i686/PKGBUILD
  nvidia-340xx/repos/extra-i686/fs52243.patch
  nvidia-340xx/repos/extra-i686/nvidia-340xx.install
  nvidia-340xx/repos/extra-x86_64/4.10.0_kernel.patch
  nvidia-340xx/repos/extra-x86_64/PKGBUILD
  nvidia-340xx/repos/extra-x86_64/fs52243.patch
  nvidia-340xx/repos/extra-x86_64/nvidia-340xx.install
  nvidia-340xx/repos/testing-i686/
  nvidia-340xx/repos/testing-x86_64/

-----------------------------------+
 /4.10.0_kernel.patch              |  262 ++++++++++++++++++++++++++++++++++++
 /PKGBUILD                         |  148 ++++++++++++++++++++
 /fs52243.patch                    |   28 +++
 /nvidia-340xx.install             |   26 +++
 extra-i686/4.10.0_kernel.patch    |  131 ------------------
 extra-i686/PKGBUILD               |   74 ----------
 extra-i686/fs52243.patch          |   14 -
 extra-i686/nvidia-340xx.install   |   13 -
 extra-x86_64/4.10.0_kernel.patch  |  131 ------------------
 extra-x86_64/PKGBUILD             |   74 ----------
 extra-x86_64/fs52243.patch        |   14 -
 extra-x86_64/nvidia-340xx.install |   13 -
 12 files changed, 464 insertions(+), 464 deletions(-)

Deleted: extra-i686/4.10.0_kernel.patch
===================================================================
--- extra-i686/4.10.0_kernel.patch	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-i686/4.10.0_kernel.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,131 +0,0 @@
-From 983a2ca221a371e08bb5ad11758a729cfa5aa88c Mon Sep 17 00:00:00 2001
-From: Alberto Milone <alberto.milone at canonical.com>
-Date: Wed, 15 Feb 2017 17:05:55 +0100
-Subject: [PATCH 1/1] Add support for Linux 4.10
-
----
- nv-linux.h            |  7 +++++++
- nv-pat.c              | 40 ++++++++++++++++++++++++++++++++++++++++
- uvm/nvidia_uvm_lite.c |  4 ++++
- 3 files changed, 51 insertions(+)
-
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index e7068e3..2d62492 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid)
-  *    2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
-  */
- 
-+#include <linux/version.h>
-+
- #if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
-     #if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
-         #define NV_GET_USER_PAGES           get_user_pages
-@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
- 
-         #else
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
-                                             pages, vmas);
-+#else
-+               return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
-+                                            pages, vmas, NULL);
-+#endif
- 
-         #endif
- 
-diff --git a/kernel/nv-pat.c b/kernel/nv-pat.c
-index a725533..cec6f3f 100644
---- a/kernel/nv-pat.c
-+++ b/kernel/nv-pat.c
-@@ -203,6 +203,7 @@ void nv_disable_pat_support(void)
- }
- 
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
- static int
- nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
- {
-@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {
-     .notifier_call = nvidia_cpu_callback,
-     .priority = 0
- };
-+#else
-+static int nvidia_cpu_online(unsigned int hcpu)
-+{
-+    unsigned int cpu = get_cpu();
-+    if (cpu == hcpu)
-+        nv_setup_pat_entries(NULL);
-+    else
-+        NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1);
-+
-+    put_cpu();
-+
-+    return 0;
-+}
-+
-+static int nvidia_cpu_down_prep(unsigned int hcpu)
-+{
-+    unsigned int cpu = get_cpu();
-+    if (cpu == hcpu)
-+        nv_restore_pat_entries(NULL);
-+    else
-+        NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1);
-+
-+    put_cpu();
-+
-+    return 0;
-+}
-+#endif
-+
- #endif
- 
- int nv_init_pat_support(nv_stack_t *sp)
-@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp)
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-         if (nv_pat_mode == NV_PAT_MODE_BUILTIN)
-         {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-             if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
-+#else
-+            if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
-+                                  "gpu/nvidia:online",
-+                                  nvidia_cpu_online,
-+                                  nvidia_cpu_down_prep) != 0)
-+#endif
-             {
-                 nv_disable_pat_support();
-                 nv_printf(NV_DBG_ERRORS,
-@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void)
-     {
-         nv_disable_pat_support();
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-         unregister_hotcpu_notifier(&nv_hotcpu_nfb);
-+#else
-+        cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
-+#endif
- #endif
-     }
- }
-diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
-index 9627f60..2158b45 100644
---- a/kernel/uvm/nvidia_uvm_lite.c
-+++ b/kernel/uvm/nvidia_uvm_lite.c
-@@ -820,7 +820,11 @@ done:
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
- int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-     unsigned long vaddr = (unsigned long)vmf->virtual_address;
-+#else
-+    unsigned long vaddr = (unsigned long)vmf->address;
-+#endif
-     struct page *page = NULL;
-     int retval;
- 
--- 
-2.7.4
-

Copied: nvidia-340xx/repos/extra-i686/4.10.0_kernel.patch (from rev 291106, nvidia-340xx/repos/testing-i686/4.10.0_kernel.patch)
===================================================================
--- extra-i686/4.10.0_kernel.patch	                        (rev 0)
+++ extra-i686/4.10.0_kernel.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,131 @@
+From 983a2ca221a371e08bb5ad11758a729cfa5aa88c Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone at canonical.com>
+Date: Wed, 15 Feb 2017 17:05:55 +0100
+Subject: [PATCH 1/1] Add support for Linux 4.10
+
+---
+ nv-linux.h            |  7 +++++++
+ nv-pat.c              | 40 ++++++++++++++++++++++++++++++++++++++++
+ uvm/nvidia_uvm_lite.c |  4 ++++
+ 3 files changed, 51 insertions(+)
+
+diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
+index e7068e3..2d62492 100644
+--- a/kernel/nv-linux.h
++++ b/kernel/nv-linux.h
+@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid)
+  *    2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
+  */
+ 
++#include <linux/version.h>
++
+ #if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
+     #if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
+         #define NV_GET_USER_PAGES           get_user_pages
+@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
+ 
+         #else
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
+                                             pages, vmas);
++#else
++               return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
++                                            pages, vmas, NULL);
++#endif
+ 
+         #endif
+ 
+diff --git a/kernel/nv-pat.c b/kernel/nv-pat.c
+index a725533..cec6f3f 100644
+--- a/kernel/nv-pat.c
++++ b/kernel/nv-pat.c
+@@ -203,6 +203,7 @@ void nv_disable_pat_support(void)
+ }
+ 
+ #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+ static int
+ nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+ {
+@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {
+     .notifier_call = nvidia_cpu_callback,
+     .priority = 0
+ };
++#else
++static int nvidia_cpu_online(unsigned int hcpu)
++{
++    unsigned int cpu = get_cpu();
++    if (cpu == hcpu)
++        nv_setup_pat_entries(NULL);
++    else
++        NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1);
++
++    put_cpu();
++
++    return 0;
++}
++
++static int nvidia_cpu_down_prep(unsigned int hcpu)
++{
++    unsigned int cpu = get_cpu();
++    if (cpu == hcpu)
++        nv_restore_pat_entries(NULL);
++    else
++        NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1);
++
++    put_cpu();
++
++    return 0;
++}
++#endif
++
+ #endif
+ 
+ int nv_init_pat_support(nv_stack_t *sp)
+@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp)
+ #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
+         if (nv_pat_mode == NV_PAT_MODE_BUILTIN)
+         {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+             if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
++#else
++            if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
++                                  "gpu/nvidia:online",
++                                  nvidia_cpu_online,
++                                  nvidia_cpu_down_prep) != 0)
++#endif
+             {
+                 nv_disable_pat_support();
+                 nv_printf(NV_DBG_ERRORS,
+@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void)
+     {
+         nv_disable_pat_support();
+ #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+         unregister_hotcpu_notifier(&nv_hotcpu_nfb);
++#else
++        cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
++#endif
+ #endif
+     }
+ }
+diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
+index 9627f60..2158b45 100644
+--- a/kernel/uvm/nvidia_uvm_lite.c
++++ b/kernel/uvm/nvidia_uvm_lite.c
+@@ -820,7 +820,11 @@ done:
+ #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+ int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+     unsigned long vaddr = (unsigned long)vmf->virtual_address;
++#else
++    unsigned long vaddr = (unsigned long)vmf->address;
++#endif
+     struct page *page = NULL;
+     int retval;
+ 
+-- 
+2.7.4
+

Deleted: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-i686/PKGBUILD	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,74 +0,0 @@
-# $Id$
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Thomas Baechler <thomas at archlinux.org>
-
-pkgbase=nvidia-340xx
-pkgname=(nvidia-340xx nvidia-340xx-dkms)
-pkgver=340.102
-_extramodules=extramodules-4.10-ARCH
-pkgrel=4
-arch=('i686' 'x86_64')
-url="http://www.nvidia.com/"
-makedepends=("nvidia-340xx-utils=${pkgver}" 'linux' 'linux-headers>=4.10' 'linux-headers<4.11')
-conflicts=('nvidia')
-license=('custom')
-options=(!strip)
-source=('fs52243.patch' '4.10.0_kernel.patch')
-source_i686+=("http://us.download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run")
-source_x86_64+=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
-sha512sums=('de4f697d64f8e73c4aadec1a407884a6bc459c0020d4bfd19740fe4177a60bb801fe8a74ef6f7fa2e89c6cd648ea4daf152799ae344a145c06480a6eef0c5bca'
-            '88a2b448c1e8445dc43820328e86d8f20eb7e3cb5774e704cd44191a9fa26064264510c1adc9ea938fa2c92075496f3a27bd52ae6e6f4ec5fa6d4a829dd961e8')
-sha512sums_i686=('bea700c925a6044fcded40324bb389c5fa1aadc40831f685a76e7b0ded11161f492960950c201467e564d157dcbe0c330d13a2014f51d0073002c5a262a6f0ca')
-sha512sums_x86_64=('2a29e6418244ea384e4237d74057bd8e56247b1c503cf623dea34a3b1065d8783879aa7e6a802dd31f0a10cf81cfcab2a1b1a8269b97996f15fa1838c0a3a44b')
-
-[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
-[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
-
-prepare() {
-    sh "${_pkg}.run" --extract-only
-    cd "${_pkg}"
-    # patches here
-
-    patch -Np0 < "${srcdir}"/fs52243.patch
-    patch -Np1 < "${srcdir}"/4.10.0_kernel.patch
-
-    cp -a kernel kernel-dkms
-}
-
-build() {
-    _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
-    cd "${_pkg}"/kernel
-    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
-
-    cd uvm
-    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
-}
-
-package_nvidia-340xx() {
-    pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
-    depends=('linux>=4.10' 'linux<4.11' 'libgl' "nvidia-340xx-utils=${pkgver}")
-    conflict+=('nvidia-340xx-dkms')
-    install=nvidia-340xx.install
-
-    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
-        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
-    install -D -m644 "${srcdir}/${_pkg}/kernel/uvm/nvidia-uvm.ko" \
-        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
-    gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
-    install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
-    echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
-}
-
-package_nvidia-340xx-dkms() {
-    pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
-    depends=('dkms' "nvidia-340xx-utils=$pkgver")
-    optdepends=('linux-headers: Build the module for Arch kernel'
-                'linux-lts-headers: Build the module for LTS Arch kernel')
-    conflicts+=('nvidia-340xx')
-
-    cd ${_pkg}
-    install -dm 755 "${pkgdir}"/usr/{lib/modprobe.d,src}
-    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}"/usr/src/nvidia-${pkgver}
-    echo 'blacklist nouveau' > "${pkgdir}"/usr/lib/modprobe.d/nvidia.conf
-    cat "${pkgdir}"/usr/src/nvidia-${pkgver}/uvm/dkms.conf.fragment >> "${pkgdir}"/usr/src/nvidia-${pkgver}/dkms.conf
-}

Copied: nvidia-340xx/repos/extra-i686/PKGBUILD (from rev 291106, nvidia-340xx/repos/testing-i686/PKGBUILD)
===================================================================
--- extra-i686/PKGBUILD	                        (rev 0)
+++ extra-i686/PKGBUILD	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,74 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Thomas Baechler <thomas at archlinux.org>
+
+pkgbase=nvidia-340xx
+pkgname=(nvidia-340xx nvidia-340xx-dkms)
+pkgver=340.102
+_extramodules=extramodules-4.10-ARCH
+pkgrel=5
+arch=('i686' 'x86_64')
+url="http://www.nvidia.com/"
+makedepends=("nvidia-340xx-utils=${pkgver}" 'linux' 'linux-headers>=4.10' 'linux-headers<4.11')
+conflicts=('nvidia')
+license=('custom')
+options=(!strip)
+source=('fs52243.patch' '4.10.0_kernel.patch')
+source_i686+=("http://us.download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run")
+source_x86_64+=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
+sha512sums=('de4f697d64f8e73c4aadec1a407884a6bc459c0020d4bfd19740fe4177a60bb801fe8a74ef6f7fa2e89c6cd648ea4daf152799ae344a145c06480a6eef0c5bca'
+            '88a2b448c1e8445dc43820328e86d8f20eb7e3cb5774e704cd44191a9fa26064264510c1adc9ea938fa2c92075496f3a27bd52ae6e6f4ec5fa6d4a829dd961e8')
+sha512sums_i686=('bea700c925a6044fcded40324bb389c5fa1aadc40831f685a76e7b0ded11161f492960950c201467e564d157dcbe0c330d13a2014f51d0073002c5a262a6f0ca')
+sha512sums_x86_64=('2a29e6418244ea384e4237d74057bd8e56247b1c503cf623dea34a3b1065d8783879aa7e6a802dd31f0a10cf81cfcab2a1b1a8269b97996f15fa1838c0a3a44b')
+
+[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
+[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
+
+prepare() {
+    sh "${_pkg}.run" --extract-only
+    cd "${_pkg}"
+    # patches here
+
+    patch -Np0 < "${srcdir}"/fs52243.patch
+    patch -Np1 < "${srcdir}"/4.10.0_kernel.patch
+
+    cp -a kernel kernel-dkms
+}
+
+build() {
+    _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
+    cd "${_pkg}"/kernel
+    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
+
+    cd uvm
+    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
+}
+
+package_nvidia-340xx() {
+    pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
+    depends=('linux>=4.10' 'linux<4.11' 'libgl' "nvidia-340xx-utils=${pkgver}")
+    conflict+=('nvidia-340xx-dkms')
+    install=nvidia-340xx.install
+
+    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
+        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
+    install -D -m644 "${srcdir}/${_pkg}/kernel/uvm/nvidia-uvm.ko" \
+        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
+    gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
+    install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
+    echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
+}
+
+package_nvidia-340xx-dkms() {
+    pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
+    depends=('dkms' "nvidia-340xx-utils=$pkgver")
+    optdepends=('linux-headers: Build the module for Arch kernel'
+                'linux-lts-headers: Build the module for LTS Arch kernel')
+    conflicts+=('nvidia-340xx')
+
+    cd ${_pkg}
+    install -dm 755 "${pkgdir}"/usr/{lib/modprobe.d,src}
+    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}"/usr/src/nvidia-${pkgver}
+    echo 'blacklist nouveau' > "${pkgdir}"/usr/lib/modprobe.d/nvidia.conf
+    cat "${pkgdir}"/usr/src/nvidia-${pkgver}/uvm/dkms.conf.fragment >> "${pkgdir}"/usr/src/nvidia-${pkgver}/dkms.conf
+}

Deleted: extra-i686/fs52243.patch
===================================================================
--- extra-i686/fs52243.patch	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-i686/fs52243.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,14 +0,0 @@
---- kernel/nv-drm.c	2016-12-15 12:41:26.000000000 +0100
-+++ kernel/nv-drm.c	2016-12-15 12:58:48.000000000 +0100
-@@ -115,7 +115,11 @@
- };
- 
- static struct drm_driver nv_drm_driver = {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
-+    .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
-+#else
-     .driver_features = DRIVER_GEM | DRIVER_PRIME,
-+#endif
-     .load = nv_drm_load,
-     .unload = nv_drm_unload,
-     .fops = &nv_drm_fops,

Copied: nvidia-340xx/repos/extra-i686/fs52243.patch (from rev 291106, nvidia-340xx/repos/testing-i686/fs52243.patch)
===================================================================
--- extra-i686/fs52243.patch	                        (rev 0)
+++ extra-i686/fs52243.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,14 @@
+--- kernel/nv-drm.c	2016-12-15 12:41:26.000000000 +0100
++++ kernel/nv-drm.c	2016-12-15 12:58:48.000000000 +0100
+@@ -115,7 +115,11 @@
+ };
+ 
+ static struct drm_driver nv_drm_driver = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++    .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
++#else
+     .driver_features = DRIVER_GEM | DRIVER_PRIME,
++#endif
+     .load = nv_drm_load,
+     .unload = nv_drm_unload,
+     .fops = &nv_drm_fops,

Deleted: extra-i686/nvidia-340xx.install
===================================================================
--- extra-i686/nvidia-340xx.install	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-i686/nvidia-340xx.install	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,13 +0,0 @@
-post_install() {
-    EXTRAMODULES='extramodules-4.10-ARCH'
-    depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
-    echo 'In order to use nvidia module, reboot the system.'
-}
-
-post_upgrade() {
-    post_install
-}
-
-post_remove() {
-    post_install
-}

Copied: nvidia-340xx/repos/extra-i686/nvidia-340xx.install (from rev 291106, nvidia-340xx/repos/testing-i686/nvidia-340xx.install)
===================================================================
--- extra-i686/nvidia-340xx.install	                        (rev 0)
+++ extra-i686/nvidia-340xx.install	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,13 @@
+post_install() {
+    EXTRAMODULES='extramodules-4.10-ARCH'
+    depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+    echo 'In order to use nvidia module, reboot the system.'
+}
+
+post_upgrade() {
+    post_install
+}
+
+post_remove() {
+    post_install
+}

Deleted: extra-x86_64/4.10.0_kernel.patch
===================================================================
--- extra-x86_64/4.10.0_kernel.patch	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-x86_64/4.10.0_kernel.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,131 +0,0 @@
-From 983a2ca221a371e08bb5ad11758a729cfa5aa88c Mon Sep 17 00:00:00 2001
-From: Alberto Milone <alberto.milone at canonical.com>
-Date: Wed, 15 Feb 2017 17:05:55 +0100
-Subject: [PATCH 1/1] Add support for Linux 4.10
-
----
- nv-linux.h            |  7 +++++++
- nv-pat.c              | 40 ++++++++++++++++++++++++++++++++++++++++
- uvm/nvidia_uvm_lite.c |  4 ++++
- 3 files changed, 51 insertions(+)
-
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index e7068e3..2d62492 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid)
-  *    2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
-  */
- 
-+#include <linux/version.h>
-+
- #if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
-     #if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
-         #define NV_GET_USER_PAGES           get_user_pages
-@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
- 
-         #else
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
-                                             pages, vmas);
-+#else
-+               return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
-+                                            pages, vmas, NULL);
-+#endif
- 
-         #endif
- 
-diff --git a/kernel/nv-pat.c b/kernel/nv-pat.c
-index a725533..cec6f3f 100644
---- a/kernel/nv-pat.c
-+++ b/kernel/nv-pat.c
-@@ -203,6 +203,7 @@ void nv_disable_pat_support(void)
- }
- 
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
- static int
- nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
- {
-@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {
-     .notifier_call = nvidia_cpu_callback,
-     .priority = 0
- };
-+#else
-+static int nvidia_cpu_online(unsigned int hcpu)
-+{
-+    unsigned int cpu = get_cpu();
-+    if (cpu == hcpu)
-+        nv_setup_pat_entries(NULL);
-+    else
-+        NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1);
-+
-+    put_cpu();
-+
-+    return 0;
-+}
-+
-+static int nvidia_cpu_down_prep(unsigned int hcpu)
-+{
-+    unsigned int cpu = get_cpu();
-+    if (cpu == hcpu)
-+        nv_restore_pat_entries(NULL);
-+    else
-+        NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1);
-+
-+    put_cpu();
-+
-+    return 0;
-+}
-+#endif
-+
- #endif
- 
- int nv_init_pat_support(nv_stack_t *sp)
-@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp)
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-         if (nv_pat_mode == NV_PAT_MODE_BUILTIN)
-         {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-             if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
-+#else
-+            if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
-+                                  "gpu/nvidia:online",
-+                                  nvidia_cpu_online,
-+                                  nvidia_cpu_down_prep) != 0)
-+#endif
-             {
-                 nv_disable_pat_support();
-                 nv_printf(NV_DBG_ERRORS,
-@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void)
-     {
-         nv_disable_pat_support();
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-         unregister_hotcpu_notifier(&nv_hotcpu_nfb);
-+#else
-+        cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
-+#endif
- #endif
-     }
- }
-diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
-index 9627f60..2158b45 100644
---- a/kernel/uvm/nvidia_uvm_lite.c
-+++ b/kernel/uvm/nvidia_uvm_lite.c
-@@ -820,7 +820,11 @@ done:
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
- int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-     unsigned long vaddr = (unsigned long)vmf->virtual_address;
-+#else
-+    unsigned long vaddr = (unsigned long)vmf->address;
-+#endif
-     struct page *page = NULL;
-     int retval;
- 
--- 
-2.7.4
-

Copied: nvidia-340xx/repos/extra-x86_64/4.10.0_kernel.patch (from rev 291106, nvidia-340xx/repos/testing-x86_64/4.10.0_kernel.patch)
===================================================================
--- extra-x86_64/4.10.0_kernel.patch	                        (rev 0)
+++ extra-x86_64/4.10.0_kernel.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,131 @@
+From 983a2ca221a371e08bb5ad11758a729cfa5aa88c Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone at canonical.com>
+Date: Wed, 15 Feb 2017 17:05:55 +0100
+Subject: [PATCH 1/1] Add support for Linux 4.10
+
+---
+ nv-linux.h            |  7 +++++++
+ nv-pat.c              | 40 ++++++++++++++++++++++++++++++++++++++++
+ uvm/nvidia_uvm_lite.c |  4 ++++
+ 3 files changed, 51 insertions(+)
+
+diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
+index e7068e3..2d62492 100644
+--- a/kernel/nv-linux.h
++++ b/kernel/nv-linux.h
+@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid)
+  *    2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
+  */
+ 
++#include <linux/version.h>
++
+ #if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
+     #if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
+         #define NV_GET_USER_PAGES           get_user_pages
+@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
+ 
+         #else
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
+                                             pages, vmas);
++#else
++               return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
++                                            pages, vmas, NULL);
++#endif
+ 
+         #endif
+ 
+diff --git a/kernel/nv-pat.c b/kernel/nv-pat.c
+index a725533..cec6f3f 100644
+--- a/kernel/nv-pat.c
++++ b/kernel/nv-pat.c
+@@ -203,6 +203,7 @@ void nv_disable_pat_support(void)
+ }
+ 
+ #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+ static int
+ nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+ {
+@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {
+     .notifier_call = nvidia_cpu_callback,
+     .priority = 0
+ };
++#else
++static int nvidia_cpu_online(unsigned int hcpu)
++{
++    unsigned int cpu = get_cpu();
++    if (cpu == hcpu)
++        nv_setup_pat_entries(NULL);
++    else
++        NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1);
++
++    put_cpu();
++
++    return 0;
++}
++
++static int nvidia_cpu_down_prep(unsigned int hcpu)
++{
++    unsigned int cpu = get_cpu();
++    if (cpu == hcpu)
++        nv_restore_pat_entries(NULL);
++    else
++        NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1);
++
++    put_cpu();
++
++    return 0;
++}
++#endif
++
+ #endif
+ 
+ int nv_init_pat_support(nv_stack_t *sp)
+@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp)
+ #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
+         if (nv_pat_mode == NV_PAT_MODE_BUILTIN)
+         {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+             if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
++#else
++            if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
++                                  "gpu/nvidia:online",
++                                  nvidia_cpu_online,
++                                  nvidia_cpu_down_prep) != 0)
++#endif
+             {
+                 nv_disable_pat_support();
+                 nv_printf(NV_DBG_ERRORS,
+@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void)
+     {
+         nv_disable_pat_support();
+ #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+         unregister_hotcpu_notifier(&nv_hotcpu_nfb);
++#else
++        cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
++#endif
+ #endif
+     }
+ }
+diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
+index 9627f60..2158b45 100644
+--- a/kernel/uvm/nvidia_uvm_lite.c
++++ b/kernel/uvm/nvidia_uvm_lite.c
+@@ -820,7 +820,11 @@ done:
+ #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+ int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+     unsigned long vaddr = (unsigned long)vmf->virtual_address;
++#else
++    unsigned long vaddr = (unsigned long)vmf->address;
++#endif
+     struct page *page = NULL;
+     int retval;
+ 
+-- 
+2.7.4
+

Deleted: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-x86_64/PKGBUILD	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,74 +0,0 @@
-# $Id$
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Thomas Baechler <thomas at archlinux.org>
-
-pkgbase=nvidia-340xx
-pkgname=(nvidia-340xx nvidia-340xx-dkms)
-pkgver=340.102
-_extramodules=extramodules-4.10-ARCH
-pkgrel=4
-arch=('i686' 'x86_64')
-url="http://www.nvidia.com/"
-makedepends=("nvidia-340xx-utils=${pkgver}" 'linux' 'linux-headers>=4.10' 'linux-headers<4.11')
-conflicts=('nvidia')
-license=('custom')
-options=(!strip)
-source=('fs52243.patch' '4.10.0_kernel.patch')
-source_i686+=("http://us.download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run")
-source_x86_64+=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
-sha512sums=('de4f697d64f8e73c4aadec1a407884a6bc459c0020d4bfd19740fe4177a60bb801fe8a74ef6f7fa2e89c6cd648ea4daf152799ae344a145c06480a6eef0c5bca'
-            '88a2b448c1e8445dc43820328e86d8f20eb7e3cb5774e704cd44191a9fa26064264510c1adc9ea938fa2c92075496f3a27bd52ae6e6f4ec5fa6d4a829dd961e8')
-sha512sums_i686=('bea700c925a6044fcded40324bb389c5fa1aadc40831f685a76e7b0ded11161f492960950c201467e564d157dcbe0c330d13a2014f51d0073002c5a262a6f0ca')
-sha512sums_x86_64=('2a29e6418244ea384e4237d74057bd8e56247b1c503cf623dea34a3b1065d8783879aa7e6a802dd31f0a10cf81cfcab2a1b1a8269b97996f15fa1838c0a3a44b')
-
-[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
-[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
-
-prepare() {
-    sh "${_pkg}.run" --extract-only
-    cd "${_pkg}"
-    # patches here
-
-    patch -Np0 < "${srcdir}"/fs52243.patch
-    patch -Np1 < "${srcdir}"/4.10.0_kernel.patch
-
-    cp -a kernel kernel-dkms
-}
-
-build() {
-    _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
-    cd "${_pkg}"/kernel
-    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
-
-    cd uvm
-    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
-}
-
-package_nvidia-340xx() {
-    pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
-    depends=('linux>=4.10' 'linux<4.11' 'libgl' "nvidia-340xx-utils=${pkgver}")
-    conflict+=('nvidia-340xx-dkms')
-    install=nvidia-340xx.install
-
-    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
-        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
-    install -D -m644 "${srcdir}/${_pkg}/kernel/uvm/nvidia-uvm.ko" \
-        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
-    gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
-    install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
-    echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
-}
-
-package_nvidia-340xx-dkms() {
-    pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
-    depends=('dkms' "nvidia-340xx-utils=$pkgver")
-    optdepends=('linux-headers: Build the module for Arch kernel'
-                'linux-lts-headers: Build the module for LTS Arch kernel')
-    conflicts+=('nvidia-340xx')
-
-    cd ${_pkg}
-    install -dm 755 "${pkgdir}"/usr/{lib/modprobe.d,src}
-    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}"/usr/src/nvidia-${pkgver}
-    echo 'blacklist nouveau' > "${pkgdir}"/usr/lib/modprobe.d/nvidia.conf
-    cat "${pkgdir}"/usr/src/nvidia-${pkgver}/uvm/dkms.conf.fragment >> "${pkgdir}"/usr/src/nvidia-${pkgver}/dkms.conf
-}

Copied: nvidia-340xx/repos/extra-x86_64/PKGBUILD (from rev 291106, nvidia-340xx/repos/testing-x86_64/PKGBUILD)
===================================================================
--- extra-x86_64/PKGBUILD	                        (rev 0)
+++ extra-x86_64/PKGBUILD	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,74 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Thomas Baechler <thomas at archlinux.org>
+
+pkgbase=nvidia-340xx
+pkgname=(nvidia-340xx nvidia-340xx-dkms)
+pkgver=340.102
+_extramodules=extramodules-4.10-ARCH
+pkgrel=5
+arch=('i686' 'x86_64')
+url="http://www.nvidia.com/"
+makedepends=("nvidia-340xx-utils=${pkgver}" 'linux' 'linux-headers>=4.10' 'linux-headers<4.11')
+conflicts=('nvidia')
+license=('custom')
+options=(!strip)
+source=('fs52243.patch' '4.10.0_kernel.patch')
+source_i686+=("http://us.download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run")
+source_x86_64+=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
+sha512sums=('de4f697d64f8e73c4aadec1a407884a6bc459c0020d4bfd19740fe4177a60bb801fe8a74ef6f7fa2e89c6cd648ea4daf152799ae344a145c06480a6eef0c5bca'
+            '88a2b448c1e8445dc43820328e86d8f20eb7e3cb5774e704cd44191a9fa26064264510c1adc9ea938fa2c92075496f3a27bd52ae6e6f4ec5fa6d4a829dd961e8')
+sha512sums_i686=('bea700c925a6044fcded40324bb389c5fa1aadc40831f685a76e7b0ded11161f492960950c201467e564d157dcbe0c330d13a2014f51d0073002c5a262a6f0ca')
+sha512sums_x86_64=('2a29e6418244ea384e4237d74057bd8e56247b1c503cf623dea34a3b1065d8783879aa7e6a802dd31f0a10cf81cfcab2a1b1a8269b97996f15fa1838c0a3a44b')
+
+[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
+[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
+
+prepare() {
+    sh "${_pkg}.run" --extract-only
+    cd "${_pkg}"
+    # patches here
+
+    patch -Np0 < "${srcdir}"/fs52243.patch
+    patch -Np1 < "${srcdir}"/4.10.0_kernel.patch
+
+    cp -a kernel kernel-dkms
+}
+
+build() {
+    _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
+    cd "${_pkg}"/kernel
+    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
+
+    cd uvm
+    make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
+}
+
+package_nvidia-340xx() {
+    pkgdesc="NVIDIA drivers for linux, 340xx legacy branch"
+    depends=('linux>=4.10' 'linux<4.11' 'libgl' "nvidia-340xx-utils=${pkgver}")
+    conflict+=('nvidia-340xx-dkms')
+    install=nvidia-340xx.install
+
+    install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
+        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
+    install -D -m644 "${srcdir}/${_pkg}/kernel/uvm/nvidia-uvm.ko" \
+        "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
+    gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
+    install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
+    echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
+}
+
+package_nvidia-340xx-dkms() {
+    pkgdesc="NVIDIA driver sources for linux, 340xx legacy branch"
+    depends=('dkms' "nvidia-340xx-utils=$pkgver")
+    optdepends=('linux-headers: Build the module for Arch kernel'
+                'linux-lts-headers: Build the module for LTS Arch kernel')
+    conflicts+=('nvidia-340xx')
+
+    cd ${_pkg}
+    install -dm 755 "${pkgdir}"/usr/{lib/modprobe.d,src}
+    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}"/usr/src/nvidia-${pkgver}
+    echo 'blacklist nouveau' > "${pkgdir}"/usr/lib/modprobe.d/nvidia.conf
+    cat "${pkgdir}"/usr/src/nvidia-${pkgver}/uvm/dkms.conf.fragment >> "${pkgdir}"/usr/src/nvidia-${pkgver}/dkms.conf
+}

Deleted: extra-x86_64/fs52243.patch
===================================================================
--- extra-x86_64/fs52243.patch	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-x86_64/fs52243.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,14 +0,0 @@
---- kernel/nv-drm.c	2016-12-15 12:41:26.000000000 +0100
-+++ kernel/nv-drm.c	2016-12-15 12:58:48.000000000 +0100
-@@ -115,7 +115,11 @@
- };
- 
- static struct drm_driver nv_drm_driver = {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
-+    .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
-+#else
-     .driver_features = DRIVER_GEM | DRIVER_PRIME,
-+#endif
-     .load = nv_drm_load,
-     .unload = nv_drm_unload,
-     .fops = &nv_drm_fops,

Copied: nvidia-340xx/repos/extra-x86_64/fs52243.patch (from rev 291106, nvidia-340xx/repos/testing-x86_64/fs52243.patch)
===================================================================
--- extra-x86_64/fs52243.patch	                        (rev 0)
+++ extra-x86_64/fs52243.patch	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,14 @@
+--- kernel/nv-drm.c	2016-12-15 12:41:26.000000000 +0100
++++ kernel/nv-drm.c	2016-12-15 12:58:48.000000000 +0100
+@@ -115,7 +115,11 @@
+ };
+ 
+ static struct drm_driver nv_drm_driver = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++    .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
++#else
+     .driver_features = DRIVER_GEM | DRIVER_PRIME,
++#endif
+     .load = nv_drm_load,
+     .unload = nv_drm_unload,
+     .fops = &nv_drm_fops,

Deleted: extra-x86_64/nvidia-340xx.install
===================================================================
--- extra-x86_64/nvidia-340xx.install	2017-03-20 13:41:15 UTC (rev 291106)
+++ extra-x86_64/nvidia-340xx.install	2017-03-20 13:41:18 UTC (rev 291107)
@@ -1,13 +0,0 @@
-post_install() {
-    EXTRAMODULES='extramodules-4.10-ARCH'
-    depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
-    echo 'In order to use nvidia module, reboot the system.'
-}
-
-post_upgrade() {
-    post_install
-}
-
-post_remove() {
-    post_install
-}

Copied: nvidia-340xx/repos/extra-x86_64/nvidia-340xx.install (from rev 291106, nvidia-340xx/repos/testing-x86_64/nvidia-340xx.install)
===================================================================
--- extra-x86_64/nvidia-340xx.install	                        (rev 0)
+++ extra-x86_64/nvidia-340xx.install	2017-03-20 13:41:18 UTC (rev 291107)
@@ -0,0 +1,13 @@
+post_install() {
+    EXTRAMODULES='extramodules-4.10-ARCH'
+    depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+    echo 'In order to use nvidia module, reboot the system.'
+}
+
+post_upgrade() {
+    post_install
+}
+
+post_remove() {
+    post_install
+}


More information about the arch-commits mailing list