From ad1edf399e0f638c3ca29c7453ea941e08d13a08 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 2 Apr 2022 19:12:20 +0800 Subject: [PATCH] update for kernel 5.17 --- .SRCINFO | 6 +++-- 0009-kernel-5.17.patch | 57 ++++++++++++++++++++++++++++++++++++++++++ PKGBUILD | 6 +++-- 3 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 0009-kernel-5.17.patch diff --git a/.SRCINFO b/.SRCINFO index f996592..1303567 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = nvidia-340xx pkgdesc = NVIDIA drivers for linux, 340xx legacy branch pkgver = 340.108 - pkgrel = 28 + pkgrel = 29 url = https://www.nvidia.com/ arch = x86_64 license = custom @@ -20,6 +20,7 @@ pkgbase = nvidia-340xx source = 0006-kernel-5.14.patch source = 0007-kernel-5.15.patch source = 0008-kernel-5.16.patch + source = 0009-kernel-5.17.patch b2sums = 6538bbec53b10f8d20977f9b462052625742e9709ef06e24cf2e55de5d0c55f1620a4bb21396cfd89ebc54c32f921ea17e3e47eaa95abcbc24ecbd144fb89028 b2sums = 49d99f612e8eee3ab5e34083c25348bfd14ed5fc8a7984dafc0dad7c0ae0df2c0b2a63a1bb993da440eb0a60293d7c753ca3889bd2f51991b8ddc51bce2fe4a8 b2sums = 7150233df867a55f57aa5e798b9c7618329d98459fecc35c4acfad2e9772236cb229703c4fa072381c509279d0588173d65f46297231f4d3bfc65a1ef52e65b1 @@ -28,8 +29,9 @@ pkgbase = nvidia-340xx b2sums = 665bf0e1fa22119592e7c75ff40f265e919955f228a3e3e3ebd76e9dffa5226bece5eb032922eb2c009572b31b28e80cd89656f5d0a4ad592277edd98967e68f b2sums = 344cd3a9888a9a61941906c198d3a480ce230119c96c72c72a74b711d23face2a7b1e53b9b4639465809b84762cdc53f38210e740318866705241bc4216e4f35 b2sums = 31a4047ab84d13e32fd7fdbf9f69c696d3fab6666c541d2acf0a189c1d17c876970985167fd389a4adc0f786021172bdec1aa6d690736e3cf9fcd8ceabe5fd32 - b2sums = 08c6f5d840523ab1d047eee279e93ea04b4e006bc8aa92bfa90246a71f6632f7565700af09de32383f1f0df8c662569d54f0f34d171781b9eca97f2d2a126c92 + b2sums = b3b7bbd597252b25ccb68f431f83707a10d464996f6c74bb67143795df96054da719faf09c1ad2e1c215261356833ad3fa0d9e60552151f827f9d7be7ae44605 b2sums = caedc5651bfd14c02fb677f9c5e87adef298d871c6281b78ce184108310e4243ded82210873014be7fedee0dd6251305fa9bbce0c872b76438e0895ef76109d9 + b2sums = 9d39f9450f8e053e3436211d7031e9cc7bec5d2503816974314c3ce5b8cd194e4a6122f124693c183d237cf2a64f475e7b41f3b97029363993334728ae2a4b3f pkgname = nvidia-340xx pkgdesc = NVIDIA drivers for linux, 340xx legacy branch diff --git a/0009-kernel-5.17.patch b/0009-kernel-5.17.patch new file mode 100644 index 0000000..2c55f80 --- /dev/null +++ b/0009-kernel-5.17.patch @@ -0,0 +1,57 @@ +diff -Naur a/kernel/conftest.sh b/kernel/conftest.sh +--- a/kernel/conftest.sh 2022-04-02 10:27:54.463179319 +0000 ++++ b/kernel/conftest.sh 2022-04-02 10:27:54.553179467 +0000 +@@ -1619,7 +1619,11 @@ + CODE=" + #include + void conftest_PDE_DATA(void) { ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) ++ pde_data(); ++ #else + PDE_DATA(); ++ #endif + }" + + compile_check_conftest "$CODE" "NV_PDE_DATA_PRESENT" "" "functions" +diff -Naur a/kernel/nv-linux.h b/kernel/nv-linux.h +--- a/kernel/nv-linux.h 2022-04-02 10:27:54.463179319 +0000 ++++ b/kernel/nv-linux.h 2022-04-02 10:27:54.556512806 +0000 +@@ -266,9 +266,9 @@ + #endif + + #ifdef CONFIG_PROC_FS +-#include + #include + #endif ++#include + + #ifdef CONFIG_KDB + #include +@@ -2052,8 +2052,12 @@ + }) + + #if defined(NV_PDE_DATA_PRESENT) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + # define NV_PDE_DATA(inode) PDE_DATA(inode) + #else ++# define NV_PDE_DATA(inode) pde_data(inode) ++#endif ++#else + # define NV_PDE_DATA(inode) PDE(inode)->data + #endif + +diff -Naur a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh +--- a/kernel/uvm/conftest.sh 2022-04-02 10:27:54.456512642 +0000 ++++ b/kernel/uvm/conftest.sh 2022-04-02 10:27:54.556512806 +0000 +@@ -1578,7 +1578,11 @@ + CODE=" + #include + void conftest_PDE_DATA(void) { ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) ++ pde_data(); ++ #else + PDE_DATA(); ++ #endif + }" + + compile_check_conftest "$CODE" "NV_PDE_DATA_PRESENT" "" "functions" diff --git a/PKGBUILD b/PKGBUILD index 9c66ad2..6fb9411 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -6,7 +6,7 @@ pkgbase=nvidia-340xx pkgname=(nvidia-340xx nvidia-340xx-dkms); [ -n "$NVIDIA_340XX_DKMS_ONLY" ] && pkgname=(nvidia-340xx-dkms) pkgver=340.108 -pkgrel=28 +pkgrel=29 pkgdesc="NVIDIA drivers for linux, 340xx legacy branch" arch=('x86_64') url="https://www.nvidia.com/" @@ -25,6 +25,7 @@ source=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Li 0006-kernel-5.14.patch 0007-kernel-5.15.patch 0008-kernel-5.16.patch + 0009-kernel-5.17.patch ) b2sums=('6538bbec53b10f8d20977f9b462052625742e9709ef06e24cf2e55de5d0c55f1620a4bb21396cfd89ebc54c32f921ea17e3e47eaa95abcbc24ecbd144fb89028' '49d99f612e8eee3ab5e34083c25348bfd14ed5fc8a7984dafc0dad7c0ae0df2c0b2a63a1bb993da440eb0a60293d7c753ca3889bd2f51991b8ddc51bce2fe4a8' @@ -35,7 +36,8 @@ b2sums=('6538bbec53b10f8d20977f9b462052625742e9709ef06e24cf2e55de5d0c55f1620a4bb '344cd3a9888a9a61941906c198d3a480ce230119c96c72c72a74b711d23face2a7b1e53b9b4639465809b84762cdc53f38210e740318866705241bc4216e4f35' '31a4047ab84d13e32fd7fdbf9f69c696d3fab6666c541d2acf0a189c1d17c876970985167fd389a4adc0f786021172bdec1aa6d690736e3cf9fcd8ceabe5fd32' 'b3b7bbd597252b25ccb68f431f83707a10d464996f6c74bb67143795df96054da719faf09c1ad2e1c215261356833ad3fa0d9e60552151f827f9d7be7ae44605' - 'caedc5651bfd14c02fb677f9c5e87adef298d871c6281b78ce184108310e4243ded82210873014be7fedee0dd6251305fa9bbce0c872b76438e0895ef76109d9') + 'caedc5651bfd14c02fb677f9c5e87adef298d871c6281b78ce184108310e4243ded82210873014be7fedee0dd6251305fa9bbce0c872b76438e0895ef76109d9' + '9d39f9450f8e053e3436211d7031e9cc7bec5d2503816974314c3ce5b8cd194e4a6122f124693c183d237cf2a64f475e7b41f3b97029363993334728ae2a4b3f') _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32" # default is 'linux' substitute custom name here