Skip to content

Commit a907d45

Browse files
committed
kmod: fix OOT kpatch kmod build
Starting from linux commit 13b25489b6f8 ("kbuild: change working directory to external module directory with M="), the kpatch-build fails: make -C /root/linux M=/root/.kpatch/tmp/patch CFLAGS_MODULE='' make[1]: Entering directory '/root/linux' make[2]: Entering directory '/root/.kpatch/tmp/patch' LDS kpatch.lds make -C /root/linux M=/root/.kpatch/tmp/patch CFLAGS_MODULE='' patch-hook.o *** *** The external module source tree is not clean. *** Please run 'make -C /root/linux M=/root/linux clean' *** The easiest and quickest way to fix the build is to remove the $(KPATCH_MAKE) patch-hook.o in Makefile. Unfortunately this would mean make `patch-hook.o` cannot be performed directly. However the Makefile still lists patch-hook.o's source dependencies, so if any are updated, the kpatch module would be rebuilt anyway. Thanks for Sumanth Korikkar for reporting, debugging, and suggesting this workaround. Closes: #1430 ("kpatch-build fails: unable to locate patch-hook.o since linux commit 13b25489b6f8") Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
1 parent a9a7360 commit a907d45

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

kmod/patch/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ $(KPATCH_NAME).ko:
1919
$(obj)/$(KPATCH_NAME).o: $(src)/kpatch.lds
2020

2121
patch-hook.o: patch-hook.c kpatch-patch-hook.c livepatch-patch-hook.c
22-
$(KPATCH_MAKE) patch-hook.o
2322

2423
clean:
2524
$(RM) -Rf .*.o.cmd .*.ko.cmd .tmp_versions $(BUILDABLE_OBJS) *.ko *.mod.c \

0 commit comments

Comments
 (0)