Skip to content

Commit

Permalink
kpatch-build: handle init/version-timestamp.o
Browse files Browse the repository at this point in the history
init/version-timestamp.c is introduced after 5.19.
   2df8220cc511  kbuild: build init/built-in.a just once
The init/version-timestamp.o is built after some compilation/build has
been done, so it can have accurate version information. The
init/version-timestamp.o is used in final linking. Different build
environment, including machine or build time can make
init/version-timestamp.o different from each other.

Make two changes in kpatch-build to avoid init/version-timestamp.o
introduced build failures.

Signed-off-by: Yonghong Song <[email protected]>
Signed-off-by: Song Liu <[email protected]>
  • Loading branch information
Yonghong Song authored and liu-song-6 committed Oct 20, 2023
1 parent 101bfb5 commit 1b77c08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ find_kobj() {
arch/x86/kernel/head*.o|\
arch/x86/kernel/platform-quirks.o|\
arch/x86/lib/lib.a|\
init/version-timestamp.o|\
lib/lib.a)
KOBJFILE=vmlinux
return
Expand Down Expand Up @@ -1287,7 +1288,7 @@ for i in $FILES; do
[[ "$DISTRO" = rhel ]] || [[ "$DISTRO" = centos ]] || [[ "$DISTRO" = ol ]] && \
[[ "$i" = arch/x86/lib/copy_user_64.o ]] && continue

[[ "$i" = usr/initramfs_data.o ]] && continue
[[ "$i" = usr/initramfs_data.o || $i = init/version-timestamp.o ]] && continue

mkdir -p "output/$(dirname "$i")"
cd "$BUILDDIR" || die
Expand Down

0 comments on commit 1b77c08

Please sign in to comment.