Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions srcpkgs/nvidia470/patches/disable-objtool-override.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 77af76b80b3dea6df69af616d45e4c6a1d26bf4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
Date: Mon, 16 Feb 2026 01:07:18 +0000
Subject: [PATCH] Disable final processing of .o files with binary blobs

Due to the fact that the driver is unmaintained, and can't be adapted
to the current Linux kernel security standards (e.g. IBT), as it has a
proprietary blob; as this is likely to be an ever-growing security risk:
Use at your own risk; no warranty of any kind is provided.
---
Kbuild | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/kernel/Kbuild b/kernel/Kbuild
index f333e0b..9381ab1 100644
--- a/kernel/Kbuild
+++ b/kernel/Kbuild
@@ -55,6 +55,20 @@ ifeq ($(NV_UNDEF_BEHAVIOR_SANITIZER),1)
UBSAN_SANITIZE := y
endif

+# This is an *ugly* hack to disable objtool during the final processing of the
+# objects that embed the proprietary blobs. Objtool can't process them, as they
+# do not follow the requirements of current kernels, including support for
+# critical security features. In Ubuntu 26.04+, this causes a build error.
+# Disable it at your own risk. Note that the MIT license applies:
+# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+nvidia.o nvidia-modeset.o: override objtool-enabled =
+
$(foreach _module, $(NV_KERNEL_MODULES), \
$(eval include $(src)/$(_module)/$(_module).Kbuild))

--
2.53.0

27 changes: 27 additions & 0 deletions srcpkgs/nvidia470/patches/enable-drm-modeset-by-default.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From aa59e5d9b1ed0f8d4012d2773573c15008286a4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
Date: Sun, 31 Aug 2025 14:09:49 +0000
Subject: [PATCH] Enable nvidia-drm.modeset=1 by default

---
nvidia-drm/nvidia-drm-linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/nvidia-drm/nvidia-drm-linux.c b/kernel/nvidia-drm/nvidia-drm-linux.c
index 2319640..55de3e3 100644
--- a/kernel/nvidia-drm/nvidia-drm-linux.c
+++ b/kernel/nvidia-drm/nvidia-drm-linux.c
@@ -41,8 +41,8 @@

MODULE_PARM_DESC(
modeset,
- "Enable atomic kernel modesetting (1 = enable, 0 = disable (default))");
-bool nv_drm_modeset_module_param = false;
+ "Enable atomic kernel modesetting (1 = enable (default), 0 = disable)");
+bool nv_drm_modeset_module_param = true;
module_param_named(modeset, nv_drm_modeset_module_param, bool, 0400);

void *nv_drm_calloc(size_t nmemb, size_t size)
--
2.51.0

32 changes: 32 additions & 0 deletions srcpkgs/nvidia470/patches/nvidia-470xx-fix-gcc-15.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 3d51f7abf1c591dfd47d0070e2b6942ef91301af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
Date: Sun, 1 Jun 2025 22:14:13 +0000
Subject: [PATCH] Fix for NVIDIA 470.256.02 driver for GCC 15

conftest.sh invokes GCC on its own, without going through the usual
kernel Makefile that would add the proper CFLAGS (e.g. -std=gnu11).

This means that it builds with the default of GCC, which in GCC 15
has changed to -std=gnu23 which and has backwards incompatible changes
that the kernel does not support. Force it to -std=gnu17 instead.
---
conftest.sh | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 70c91e5..dc40d3a 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -205,6 +205,9 @@ build_cflags() {
CFLAGS="$CFLAGS -mfentry -DCC_USING_FENTRY"
fi
fi
+
+ # Specify the C standard, instead of defaulting to the compiler's
+ CFLAGS="$CFLAGS -std=gnu17"
}

CONFTEST_PREAMBLE="#include \"conftest/headers.h\"
--
2.49.0

58 changes: 58 additions & 0 deletions srcpkgs/nvidia470/patches/nvidia-470xx-fix-linux-6.13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From 9f91b171f680648647580c163bbc9cc1641e3920 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
Date: Sat, 16 Nov 2024 22:45:21 +0000
Subject: [PATCH] Tentative fix for NVIDIA 470.256.02 driver for Linux 6.13-rc1

---
nvidia-modeset/nvidia-modeset.Kbuild | 8 +++++---
nvidia/nvidia.Kbuild | 8 +++++---
2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/kernel/nvidia-modeset/nvidia-modeset.Kbuild b/kernel/nvidia-modeset/nvidia-modeset.Kbuild
index a7d84e0..d417c28 100644
--- a/kernel/nvidia-modeset/nvidia-modeset.Kbuild
+++ b/kernel/nvidia-modeset/nvidia-modeset.Kbuild
@@ -40,13 +40,15 @@ NV_KERNEL_MODULE_TARGETS += $(NVIDIA_MODESET_KO)
NVIDIA_MODESET_BINARY_OBJECT := $(src)/nvidia-modeset/nv-modeset-kernel.o_binary
NVIDIA_MODESET_BINARY_OBJECT_O := nvidia-modeset/nv-modeset-kernel.o

-quiet_cmd_symlink = SYMLINK $@
-cmd_symlink = ln -sf $< $@
+# Rel. commit 80f289101690 "kbuild: change working directory to external module directory with M=" (Masahiro Yamada, 10 Nov 2024)
+# Ensure `$<` is absolute, since the link target is resolved relative to its path, not from where `ln` is run from.
+quiet_cmd_symlinkabs = SYMLINK $@
+ cmd_symlinkabs = ln -sf $(abspath $<) $@

targets += $(NVIDIA_MODESET_BINARY_OBJECT_O)

$(obj)/$(NVIDIA_MODESET_BINARY_OBJECT_O): $(NVIDIA_MODESET_BINARY_OBJECT) FORCE
- $(call if_changed,symlink)
+ $(call if_changed,symlinkabs)

nvidia-modeset-y += $(NVIDIA_MODESET_BINARY_OBJECT_O)

diff --git a/kernel/nvidia/nvidia.Kbuild b/kernel/nvidia/nvidia.Kbuild
index 31a6f92..62689f6 100644
--- a/kernel/nvidia/nvidia.Kbuild
+++ b/kernel/nvidia/nvidia.Kbuild
@@ -40,13 +40,15 @@ NVIDIA_KO = nvidia/nvidia.ko
NVIDIA_BINARY_OBJECT := $(src)/nvidia/nv-kernel.o_binary
NVIDIA_BINARY_OBJECT_O := nvidia/nv-kernel.o

-quiet_cmd_symlink = SYMLINK $@
- cmd_symlink = ln -sf $< $@
+# Rel. commit 80f289101690 "kbuild: change working directory to external module directory with M=" (Masahiro Yamada, 10 Nov 2024)
+# Ensure `$<` is absolute, since the link target is resolved relative to its path, not from where `ln` is run from.
+quiet_cmd_symlinkabs = SYMLINK $@
+ cmd_symlinkabs = ln -sf $(abspath $<) $@

targets += $(NVIDIA_BINARY_OBJECT_O)

$(obj)/$(NVIDIA_BINARY_OBJECT_O): $(NVIDIA_BINARY_OBJECT) FORCE
- $(call if_changed,symlink)
+ $(call if_changed,symlinkabs)

nvidia-y += $(NVIDIA_BINARY_OBJECT_O)

--
2.47.0
26 changes: 26 additions & 0 deletions srcpkgs/nvidia470/patches/nvidia-470xx-fix-linux-6.14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From bee3ff1153f7b42491d2a0552d6f9a66a307ec1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
Date: Sun, 15 Dec 2024 17:56:03 +0000
Subject: [PATCH] Tentative fix for NVIDIA 470.256.02 driver for Linux 6.14-rc1

---
nvidia-drm/nvidia-drm-drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
index 0b1181d..b50b17a 100644
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -882,7 +882,10 @@ static struct drm_driver nv_drm_driver = {
.name = "nvidia-drm",

.desc = "NVIDIA DRM driver",
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0)
+ // Rel. commit. "drm: remove driver date from struct drm_driver and all drivers" (Jani Nikula, 4 Dec 2024)
.date = "20160202",
+#endif

#if defined(NV_DRM_DRIVER_HAS_DEVICE_LIST)
.device_list = LIST_HEAD_INIT(nv_drm_driver.device_list),
--
2.48.1
Loading
Loading