From 2c5694f7575cfe7a361c6df225bc2986d386c6b6 Mon Sep 17 00:00:00 2001 From: Song Liu Date: Thu, 30 May 2024 11:48:03 -0700 Subject: [PATCH] kpatch-build: Ignore missing PARA_STRUCT_SIZE for 6.8.0+ kernels struct paravirt_patch_site was removed in 6.8.0+ kernels. We should not fail kpatch-build for missing PARA_STRUCT_SIZE. Signed-off-by: Song Liu --- kpatch-build/kpatch-build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index ce542799..62ed8aea 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -272,6 +272,11 @@ support_klp_replace() fi } +check_paravirt_patch_site() +{ + ! kernel_version_gte 6.8.0 +} + find_dirs() { if [[ -e "$SCRIPTDIR/create-diff-object" ]]; then # git repo @@ -462,7 +467,9 @@ find_special_section_data() { [[ ${check[i]} && -z "$PRINTK_INDEX_STRUCT_SIZE" ]] && die "can't find special struct pi_entry size" [[ ${check[j]} && -z "$JUMP_STRUCT_SIZE" ]] && die "can't find special struct jump_entry size" [[ ${check[o]} && -z "$ORC_STRUCT_SIZE" ]] && die "can't find special struct orc_entry size" - [[ ${check[p]} && -z "$PARA_STRUCT_SIZE" ]] && die "can't find special struct paravirt_patch_site size" + if check_paravirt_patch_site; then + [[ ${check[p]} && -z "$PARA_STRUCT_SIZE" ]] && die "can't find special struct paravirt_patch_site size" + fi [[ ${check[s]} && -z "$STATIC_CALL_STRUCT_SIZE" ]] && die "can't find special struct static_call_site size" save_env