mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] kbuild: Fix 'import module' error
@ 2024-05-29 15:46 Adrian Huang
  2024-05-30 16:17 ` Nicolas Schier
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Huang @ 2024-05-29 15:46 UTC (permalink / raw)
  To: Jan Kiszka, Kieran Bingham, Masahiro Yamada
  Cc: Nicolas Schier, linux-kernel, Adrian Huang

From: Adrian Huang <ahuang12@lenovo.com>

Commit b1992c3772e6 ("kbuild: use $(src) instead of $(srctree)/$(src)
for source directory") only changes 'symlinks'. However, 'cmd_symlink'
is not changed accordingly. This leads to the following error:

Traceback (most recent call last):
  File "/your_kernel_obj/linux/vmlinux-gdb.py",
 line 29, in <module>
    import linux.utils
ModuleNotFoundError: No module named 'linux.utils'

Fix the issue by using $(src) instead of $(srctree)/$(src).

Fixes: b1992c3772e6 ("kbuild: use $(src) instead of $(srctree)/$(src) for source directory")
Signed-off-by: Adrian Huang <ahuang12@lenovo.com>
---
 scripts/gdb/linux/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile
index d77ad9079d0f..fcd32fcf3ae0 100644
--- a/scripts/gdb/linux/Makefile
+++ b/scripts/gdb/linux/Makefile
@@ -5,7 +5,7 @@ ifdef building_out_of_srctree
 symlinks := $(patsubst $(src)/%,%,$(wildcard $(src)/*.py))
 
 quiet_cmd_symlink = SYMLINK $@
-      cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@
+      cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(src))/%,$@) $@
 
 always-y += $(symlinks)
 $(addprefix $(obj)/, $(symlinks)): FORCE
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-30 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-29 15:46 [PATCH 1/1] kbuild: Fix 'import module' error Adrian Huang
2024-05-30 16:17 ` Nicolas Schier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®