Skip to content

Commit 0f59300

Browse files
committed
tar-artifacts: include selftests/bpf dependencies
Include KBUILD_OUTPUT files necessary for building selftests/bpf in a clean Linux source tree without rebuilding the kernel. That is: * "include" directories * Module.symvers * tools/objtool These together take just a couple of Mb, so they are added uncodintionally. Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
1 parent 8a4bc90 commit 0f59300

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

tar-artifacts/tar-artifacts.sh

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,25 @@ source "${GITHUB_ACTION_PATH}/../helpers.sh"
2929
"${arch}"-linux-gnu-strip --strip-debug "${KBUILD_OUTPUT}"/vmlinux
3030

3131
image_name=$(make -C ${REPO_ROOT} ARCH="$(platform_to_kernel_arch "${arch}")" -s image_name)
32-
kbuild_output_file_list=(
33-
".config"
34-
"${image_name}"
35-
"include/"
36-
"vmlinux"
37-
)
32+
kbuild_output_file_list=(".config" "${image_name}" "vmlinux")
33+
34+
function push_to_kout_list() {
35+
local item="$1"
36+
if [[ -e "${KBUILD_OUTPUT}/${item}" ]]; then
37+
kbuild_output_file_list+=("${item}")
38+
else
39+
echo "tar-artifacts.sh warning: couldn't find ${KBUILD_OUTPUT}/${item}"
40+
fi
41+
}
42+
43+
cd "${KBUILD_OUTPUT}"
44+
push_to_kout_list "Module.symvers"
45+
push_to_kout_list "scripts/"
46+
push_to_kout_list "tools/objtool/"
47+
for dir in $(find . -type d -name "include"); do
48+
push_to_kout_list "${dir}/"
49+
done
50+
cd -
3851

3952
tar -rf "${tarball}" -C "${KBUILD_OUTPUT}" \
4053
--transform "s,^,kbuild-output/," \

0 commit comments

Comments
 (0)