From 74962a62abfc350c26d1cf7cc066ef7113a30108 Mon Sep 17 00:00:00 2001 From: xtex Date: Sat, 14 Dec 2024 12:39:40 +0800 Subject: [PATCH] Fix symbolic links for Linux kernel 6.13-rc1 Cherry-pick of abc88d52ee5e86decd5e98b3223d3feec0dd66bc from nvidia-driver tracking repo. Link: https://gist.github.com/joanbm/d1f89391a4b20f4b56ba931ef6ca62da Link: https://github.com/NVIDIA/open-gpu-kernel-modules/issues/747 Author: Joan Bruguera --- kernel-open/nvidia-modeset/nvidia-modeset.Kbuild | 8 +++++--- kernel-open/nvidia/nvidia.Kbuild | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/kernel-open/nvidia-modeset/nvidia-modeset.Kbuild b/kernel-open/nvidia-modeset/nvidia-modeset.Kbuild index 9698b59e2..d0c244f62 100644 --- a/kernel-open/nvidia-modeset/nvidia-modeset.Kbuild +++ b/kernel-open/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-open/nvidia/nvidia.Kbuild b/kernel-open/nvidia/nvidia.Kbuild index ea4ef5bad..4262c6f35 100644 --- a/kernel-open/nvidia/nvidia.Kbuild +++ b/kernel-open/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)