kpatch/kmod/patch
Mike Rapoport dd1bfbecd5 livepatch-patch-hook: make callbacks addition depend on the kernel version
Since commit 926e4e0c7d ("kmod: add support
for in-kernel livepatch hooks") livepatch-patch-hook.c unconditionally
creates callbacks. This causes build error for kernels older than 4.15:

make -C /home/rppt/git/linux M=/home/rppt/.kpatch/tmp/patch livepatch-proc-vmalloc-live.ko
make[1]: Entering directory '/home/rppt/git/linux'
  CC [M]  /home/rppt/.kpatch/tmp/patch/patch-hook.o
In file included from /home/rppt/.kpatch/tmp/patch/patch-hook.c:21:0:
/home/rppt/.kpatch/tmp/patch/livepatch-patch-hook.c:82:23: error: field ‘callbacks’ has incomplete type
  struct klp_callbacks callbacks;
                       ^
/home/rppt/.kpatch/tmp/patch/livepatch-patch-hook.c: In function ‘patch_init’:
/home/rppt/.kpatch/tmp/patch/livepatch-patch-hook.c:395:10: error: ‘struct klp_object’ has no member named ‘callbacks’
   lobject->callbacks = object->callbacks;
          ^
scripts/Makefile.build:302: recipe for target '/home/rppt/.kpatch/tmp/patch/patch-hook.o' failed
make[2]: *** [/home/rppt/.kpatch/tmp/patch/patch-hook.o] Error 1
Makefile:1687: recipe for target 'livepatch-proc-vmalloc-live.ko' failed
make[1]: *** [livepatch-proc-vmalloc-live.ko] Error 2
make[1]: Leaving directory '/home/rppt/git/linux'
Makefile:20: recipe for target 'livepatch-proc-vmalloc-live.ko' failed
make: *** [livepatch-proc-vmalloc-live.ko] Error 2

Introduce HAVE_CALLBACKS to allow conditional compilation of the callbacks
addition.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
2018-04-16 20:06:38 +03:00
..
kpatch-macros.h kmod: add support for in-kernel livepatch hooks 2018-03-23 10:32:14 -04:00
kpatch-patch-hook.c kmod: add support for in-kernel livepatch hooks 2018-03-23 10:32:14 -04:00
kpatch-patch.h kmod: add support for in-kernel livepatch hooks 2018-03-23 10:32:14 -04:00
kpatch.h build and install core module with make 2014-02-18 07:44:33 -06:00
kpatch.lds.S kmod: add support for in-kernel livepatch hooks 2018-03-23 10:32:14 -04:00
livepatch-patch-hook.c livepatch-patch-hook: make callbacks addition depend on the kernel version 2018-04-16 20:06:38 +03:00
Makefile kpatch-build: set default module prefix accordingly 2017-09-20 16:30:00 -04:00
patch-hook.c CONFIG_LIVE_PATCHING -> CONFIG_LIVEPATCH 2015-02-04 08:32:08 -06:00