Skip to content

Commit

Permalink
Fix symbolic links for Linux kernel 6.13-rc1
Browse files Browse the repository at this point in the history
Cherry-pick of abc88d52ee5e86decd5e98b3223d3feec0dd66bc from nvidia-driver tracking repo.

Link: https://gist.github.com/joanbm/d1f89391a4b20f4b56ba931ef6ca62da
Link: NVIDIA#747
Author: Joan Bruguera <[email protected]>
  • Loading branch information
xtexChooser committed Dec 14, 2024
1 parent 9d0b041 commit 74962a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions kernel-open/nvidia-modeset/nvidia-modeset.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 5 additions & 3 deletions kernel-open/nvidia/nvidia.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 74962a6

Please sign in to comment.