From 1fc8bc0f38973aa0e3aaa79583065abbcd27f078 Mon Sep 17 00:00:00 2001 From: chen xiaoguang Date: Wed, 13 Sep 2017 15:08:45 +0800 Subject: [PATCH v2] kpatch: fix kpatch-build matching changed object bug v2: Change based on Joe's suggestion that revert back to ".*.o" and add a new "*/.lib_exports.o" pattern. v1: When there are ".." in source object path then current kpatch-gcc can not handle it correctly: kpatch-gcc use the following logic to check the objects who got recompiled and would write the changed objects to "chagned_objs". But if the path of the input obj is something like"arch/x86/kvm/../../../virt/kvm/.tmp_kvm_main.o" then the following logic can not handle it properly, the kvm_main.o will fall into the "*.*.o" branch. And kpatch-build will end up with "ERROR: no changed objects found. Check /root/.kpatch/build.log for more details." kpatch/kpatch-build/kpatch-gcc: ...... case "$obj" in *.mod.o|\ *built-in.o|\ vmlinux.o|\ .tmp_kallsyms1.o|\ .tmp_kallsyms2.o|\ init/version.o|\ arch/x86/boot/version.o|\ arch/x86/boot/compressed/eboot.o|\ arch/x86/boot/header.o|\ arch/x86/boot/compressed/efi_stub_64.o|\ arch/x86/boot/compressed/piggy.o|\ kernel/system_certificates.o|\ arch/x86/vdso/*|\ arch/x86/entry/vdso/*|\ drivers/firmware/efi/libstub/*|\ arch/powerpc/kernel/prom_init.o|\ *.*.o) break ;; *.o) mkdir -p "$KPATCH_GCC_TEMPDIR/orig/$(dirname $obj)" [[ -e $obj ]] && cp -f "$obj" "$KPATCH_GCC_TEMPDIR/orig/$obj" echo "$obj" >> "$KPATCH_GCC_TEMPDIR/changed_objs" break ;; *) break ;; esac ...... Cc: Joe Lawrence Signed-off-by: chen xiaoguang --- kpatch-build/kpatch-gcc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kpatch-build/kpatch-gcc b/kpatch-build/kpatch-gcc index e91f4b2..35f479f 100755 --- a/kpatch-build/kpatch-gcc +++ b/kpatch-build/kpatch-gcc @@ -38,7 +38,8 @@ if [[ "$TOOLCHAINCMD" = "gcc" ]] ; then arch/x86/entry/vdso/*|\ drivers/firmware/efi/libstub/*|\ arch/powerpc/kernel/prom_init.o|\ - *.*.o) + .*.o|\ + */.lib_exports.o) break ;; *.o) -- 1.8.3.1