Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kmod: fix OOT kpatch kmod build #1433

Merged
merged 1 commit into from
Jan 17, 2025

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 [email protected]

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 <[email protected]>
Signed-off-by: Joe Lawrence <[email protected]>
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