Skip to content

Conversation

@joe-lawrence
Copy link
Contributor

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

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: dynup#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>
Copy link
Contributor

@yhcote yhcote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@joe-lawrence joe-lawrence merged commit b15c09c into dynup:master Jan 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kpatch-build fails: unable to locate patch-hook.o since linux commit 13b25489b6f8

2 participants