ec3a16
From 1b77c087cbaf667d9ce140a7a5885bba7cca59d1 Mon Sep 17 00:00:00 2001
ec3a16
From: Yonghong Song <yonghong.song@linux.dev>
ec3a16
Date: Fri, 20 Oct 2023 14:21:30 -0700
f6c393
Subject: [PATCH 110/112] kpatch-build: handle init/version-timestamp.o
ec3a16
ec3a16
init/version-timestamp.c is introduced after 5.19.
ec3a16
   2df8220cc511  kbuild: build init/built-in.a just once
ec3a16
The init/version-timestamp.o is built after some compilation/build has
ec3a16
been done, so it can have accurate version information. The
ec3a16
init/version-timestamp.o is used in final linking. Different build
ec3a16
environment, including machine or build time can make
ec3a16
init/version-timestamp.o different from each other.
ec3a16
ec3a16
Make two changes in kpatch-build to avoid init/version-timestamp.o
ec3a16
introduced build failures.
ec3a16
ec3a16
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
ec3a16
Signed-off-by: Song Liu <song@kernel.org>
ec3a16
---
ec3a16
 kpatch-build/kpatch-build | 3 ++-
ec3a16
 1 file changed, 2 insertions(+), 1 deletion(-)
ec3a16
ec3a16
diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
ec3a16
index 429f214..3af1918 100755
ec3a16
--- a/kpatch-build/kpatch-build
ec3a16
+++ b/kpatch-build/kpatch-build
ec3a16
@@ -634,6 +634,7 @@ find_kobj() {
ec3a16
 			arch/x86/kernel/head*.o|\
ec3a16
 			arch/x86/kernel/platform-quirks.o|\
ec3a16
 			arch/x86/lib/lib.a|\
ec3a16
+			init/version-timestamp.o|\
ec3a16
 			lib/lib.a)
ec3a16
 				KOBJFILE=vmlinux
ec3a16
 				return
ec3a16
@@ -1287,7 +1288,7 @@ for i in $FILES; do
ec3a16
 	[[ "$DISTRO" = rhel ]] || [[ "$DISTRO" = centos ]] || [[ "$DISTRO" = ol ]] && \
ec3a16
 		[[ "$i" = arch/x86/lib/copy_user_64.o ]] && continue
ec3a16
 
ec3a16
-	[[ "$i" = usr/initramfs_data.o ]] && continue
ec3a16
+	[[ "$i" = usr/initramfs_data.o || $i = init/version-timestamp.o ]] && continue
ec3a16
 
ec3a16
 	mkdir -p "output/$(dirname "$i")"
ec3a16
 	cd "$BUILDDIR" || die
ec3a16
-- 
f6c393
2.45.1
ec3a16