diff --git a/lib/tests/pkgbuild.sh b/lib/tests/pkgbuild.sh index b3959cb76..cc5d701e4 100755 --- a/lib/tests/pkgbuild.sh +++ b/lib/tests/pkgbuild.sh @@ -484,4 +484,16 @@ install_kernel_selftests() for dir in arch/x86 scripts kernel/bpf samples Makefile tools include lib; do pack_contents $dir "$(dirname "${benchmark_path}/$dir")" done + + # Pack any missing symlink targets referenced from tools/ + local link target rel_target + while IFS= read -r -d '' link; do + target=$(realpath "$link" 2>/dev/null || true) + if [[ -n "$target" && -e "$target" && "$target" == "$PWD/"* ]]; then + rel_target="${target#$PWD/}" + if [[ ! -e "${benchmark_path}/$rel_target" ]]; then + pack_contents "$rel_target" "$(dirname "${benchmark_path}/$rel_target")" + fi + fi + done < <(find tools -type l -print0) }